Results 1 to 10 of 570

Thread: Tests Copying, Pasting, API Cliipboard issues. and Rough notes on Advanced API stuff

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    These next couple of codings are mine and Mike’s, as in the last post, but I have just rearranged them a bit and made very minor changes, just to make it a bit easier to compare.
    Code:
                                                                                      'Public Const HKEY_CLASSES_ROOT = &H80000000  '  https://eileenslounge.com/viewtopic.php?p=314945#p314945       https://www.devhut.net/enumerating-registry-subkeys-using-wmi-in-vba/
    Public Sub ListCLSIDs_and_ProgIDs_Mike()  ' Mike         '  https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues?p=24128&viewfull=1#post24128
    Dim Ws As Worksheet:  Set Ws = ThisWorkbook.Worksheets("CLSIDsOldVista4810TZG")        ' Set Ws = Me '
    
    Dim RegObject As Object, entryArray() As Variant, KeyValue As Variant             ' Dim KeyValue  As String ' Mike .... error is somewhat misleading. It is down to the fact that the XP (and presumably Vista and W7, although I can't test them) WMI provider (which gives us the Registry access) handles returning Null differently than the one on W10. Simply change the declaration of KeyValue from   Dim KeyValue As String  to  Dim KeyValue As Variant  https://eileenslounge.com/viewtopic.php?p=314953#p314953
                                                                                           '  Dim KeyPath As String ' - ??
                                                      Dim strComputer As String: Let strComputer = "."
     Set RegObject = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
     RegObject.EnumKey &H80000000, "CLSID", entryArray()                             ' HKEY_CLASSES_ROOT, "CLSID", entryArray()
                                                                                                                     ' Let Ws.Cells(1, 6).Value = "CLSID": Let Ws.Cells(1, 7).Value = "ProgID"
    Dim ExRowCnt As Long ' ================================================================================================
        For ExRowCnt = 0 To UBound(entryArray())
         RegObject.getstringvalue &H80000000, "CLSID\" & entryArray(ExRowCnt) & "\ProgId", "", KeyValue
         
         Let Ws.Range("F" & ExRowCnt + 2 & "") = entryArray(ExRowCnt)
         Let Ws.Range("G" & ExRowCnt + 2 & "") = KeyValue
        Next ExRowCnt ' ===================================================================================================
    End Sub
    
    Code:
    Public Sub ListCLSIDs_Me()               '  Me               http://www.eileenslounge.com/viewtopic.php?f=26&t=22603&p=289007#p289007       ' https://powershell.one/wmi/root/cimv2/stdregprov-EnumKey    '   https://www.vbforums.com/showthread.php?552899-Getting-all-sub-keys-from-a-registry-value                  https://www.vba-tutorial.de/apireferenz/registry.htm
    Dim Ws As Worksheet: Set Ws = ThisWorkbook.Worksheets("CLSIDsOldVista4810TZG")                    ' set ws = Set Ws = Me ' Set Ws = ActiveSheet
    
    Dim RegObject As Object, KeyValues() As Variant, KeyValue As Variant
     
     
     Set RegObject = GetObject("winmgmts:\\.\root\default:StdRegProv")
     RegObject.EnumKey 2147483650#, "SOFTWARE\Classes\CLSID", KeyValues()             ' https://powershell.one/wmi/root/cimv2/stdregprov-EnumKey
    
    Dim ExRowCnt As Long ' ================================================================================================
        For Each KeyValue In KeyValues()
     
         Let ExRowCnt = ExRowCnt + 1
         Let Ws.Range("A" & ExRowCnt + 1 & "") = KeyValue
         
        Next          ' ===================================================================================================
    End Sub
    '  https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues?p=24127&viewfull=1#post24127
    
    https://i.postimg.cc/FRxkK7Wd/Me-Cls...s-Prog-IDs.jpg
    ____
    Last edited by DocAElstein; 04-26-2024 at 07:22 PM.

Similar Threads

  1. Some Date Notes and Tests
    By DocAElstein in forum Test Area
    Replies: 5
    Last Post: 03-26-2025, 02:56 AM
  2. Replies: 116
    Last Post: 02-23-2025, 12:13 AM
  3. Replies: 21
    Last Post: 12-15-2024, 07:13 PM
  4. Replies: 42
    Last Post: 05-29-2023, 01:19 PM
  5. Replies: 11
    Last Post: 10-13-2013, 10:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •