Results 1 to 10 of 24

Thread: Version Info using VBA and registry quirks. InterRegional Settings GmbH

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

    Clsid Clipboard stuff, notes and Tests

    This is post 11
    https://www.excelfox.com/forum/showt...ll=1#post25005
    https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25005&viewfull=1#post25005





    Some rough Clsid Clipboard notes on this page 2 ( https://www.excelfox.com/forum/showt...ngs-GmbH/page2
    https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH/page2
    )












    In the first 3 posts is a few links, probably to be added to from time to time, and a few very very rough notes, mainly for me and unlikely useful for anyone else. More useful stuff for others is further down this Page #2 , from post #14


    2007 ht t ps://microsoft.public.word.vba.general.narkive.com/5LFhze6E/clear-office-clipboard-from-vba#post10 Tony Jollans If you are using Office 2000 you do have some indirect access to the Office Clipboard from VBA - but you do not have it in any later versions. In Office 2000 the Office Clipboard is presented as a CommandBar and so you can programmatically manipulate the Controls, for example ... CommandBars("Clipboard").Controls("Clear Clipboard").Execute
    In Office XP and later, the Office Clipboard is presented as a Task Pane and the 'back door' has been shut. AFAIK, VBA access to it post-2000 is impossible - I don't think you can even do it with SendKeys (but don't quote me on that).
    2007 ht t ps://microsoft.public.word.vba.general.narkive.com/5LFhze6E/clear-office-clipboard-from-vba#post13 Tony Jollans ….. Loosely, what happens is this: when you do a Copy operation the Windows Clipboard is cleared and whatever it is you are copying is placed in the Windows Clipboard. It may be added in several different formats (it's not Really relavant now, but some of them may go onto the clipboard itself, some of them may be pointers for the originating application to act on later request). When you do a Paste, the Windows Clipboard is asked to provide whatever is on it in the format you want and, providing that format is available, it will provide it, but still maintain whatever it holds for you to do further Pastes if you wish. In normal circumstances you should not need to do an explicit emptying of the clipboard yourself.
    Separate to all this there is, again (very) loosely, a Windows event fired when something is added to the Windows Clipboard which allows Office to know that it has happened and take a copy for the Office Clipboard. Entirely separate from the Windows Clipboard, the Office Clipboard maintains its own copies of up to 12 (Office 2000) or 24 (later versions) items. Office provides some UI facilities for manipulating the copies it holds but they are not directly available from code and no Paste operation, other than explicitly from the Office Clipboard, will use them. If you do an explicit Paste from the Office Clipboard (via the UI) what actually happens is that a (Windows) Copy operation is triggered to copy from the Office Clipboard to the Windows Clipboard and a (Windows) Paste operation is then triggered to paste from the Windows Clipboard to the specified destination.
    I confess myself at a total loss to explain how something that has been removed from the Windows Clipboard can later be Pasted; it can only happen if it has be re-placed (i.e. re-copied) on to the Windows Clipboard again - whether explicitly or implicitly as part of some other operation. So the immediate questions must be: can you verify that your copies have worked? can you verify that your clearing of the Windows clipboard has worked? and what do you do between copying and pasting? -- Enjoy,
    ht t ps://microsoft.public.word.vba.general.narkive.com/5LFhze6E/clear-office-clipboard-from-vba#post9 hybrid "thing" offered by Office

    May 2010 h tt ps://web.archive.org/web/20100506094659/ht tps://benf.org/excel/officeclip/index.html
    ht t ps://web.archive.org/web/20100506094659/http://support.microsoft.com/default.aspx/kb/221190 no joy
    May 2008 ht t ps://web.archive.org/web/20080508194547/http://msdn.microsoft.com/en-us/library/ms649052(VS.85).aspx

    Jan 2015 RickXL madness https://www.mrexcel.com/board/thread.../#post-4040646 2 you could paste to either Excel, Notepad or Paint. The clipboard has a native copy for Excel, a text version for Notepad, a bitmap for Paint, an HTML version, an XML version etc etc. According to my recent tests, it seems as if Excel saves about 29 sets of data when you make a copy. When you then try and paste it looks through the list of formats on the clipboard and finds the most suitable one

    Aug 2015 htt ps://wellsr.com/vba/2015/tutorials/vba-copy-to-clipboard-paste-clear/ Rory knicked? 2018 Update: With the rollout of Windows 8 and Windows 10, this solution no longer works reliably,



    2018 htt ps://chandoo.org/forum/threads/clipboard-copy-vba-code-not-working-in-windows-10.37126/#post-223256 Masturbator API


    12/29/2018 ht t ps://web.archive.org/web/20191220024152/ht tps://docs.microsoft.com/en-us/office/vba/language/concepts/forms/what-is-the-difference-between-the-dataobject-and-the-clipboard The DataObject and the Clipboard both provide a means to move data from one place to another. DataObject is a standard OLE object, while the Clipboard aint

    Feb 2019 https://eileenslounge.com/viewtopic....246740#p246740 3 Reset Clear Clipboard
    Feb 2019 https://eileenslounge.com/viewtopic....246740#p246740 3 My good links Reset Clear Clipboard
    https://eileenslounge.com/viewtopic....246884#p246884 2
    https://eileenslounge.com/viewtopic....246838#p246838 2
    https://eileenslounge.com/viewtopic....246770#p246770 1 with La légende du bouton
    ht tps://docs.microsoft.com/en-us/office/vba/language/concepts/forms/what-is-the-difference-between-the-dataobject-and-the-clipboard changes to
    ht tps://learn.microsoft.com/en-us/office/vba/language/concepts/forms/what-is-the-difference-between-the-dataobject-and-the-clipboard 09/13/2021

    Mar 2019 https://stackoverflow.com/questions/...60767#54960767 2

    Mar 2019 https://eileenslounge.com/viewtopic....247809#p247809 3 (Clipboard API alternative) array overflow date value Yasser rory
    Mar 2019 My last post is best, https://eileenslounge.com/viewtopic....247809#p247809 , giving further links
    Oct 2019 ht tps://social.msdn.microsoft.com/Forums/en-US/48e8c30c-24ee-458e-a873-a4e6e13f5926/dataobject-settext-and-putinclipboard-sequence-puts-invalid-data-hex-63-characters-in-clipboard?forum=isvvba not working so did archive org below which works
    htt ps://web.archive.org/web/20200806111619/h ttps://social.msdn.microsoft.com/Forums/en-US/48e8c30c-24ee-458e-a873-a4e6e13f5926/dataobject-settext-and-putinclipboard-sequence-puts-invalid-data-hex-63-characters-in-clipboard?forum=isvvba
    That seems to give > ht tp://msdn.microsoft.com/en-us/library/office/ff192913.aspx (How to: Send Information to the Clipboard); which is still as new but it is a redirect 2022 htt ps://learn.microsoft.com/en-us/office/vba/access/Concepts/Windows-API/send-information-to-the-clipboard there as new, and captures first start at Sep 2023 ??
    An old capture from Oct 2013 – htt ps://web.archive.org/web/20131003213600/http://msdn.microsoft.com/en-us/library/office/ff192913.aspx
    > htt p://msdn.microsoft.com/en-us/library/office/ff194373.aspx (How to: Retrieve Information from the Clipboard). Its dated 2022 currently as redirect htt ps://learn.microsoft.com/en-us/office/vba/access/Concepts/Windows-API/retrieve-information-from-the-clipboard
    A archive org from 2013 htt ps://web.archive.org/web/20130113075556/http://ms dn.microsoft.com/en-us/library/office/ff194373.aspx
    Maybe this was Rory’s cheat sheet from about 2015 ht tps://www.spreadsheet1.com/how-to-copy-strings-to-clipboard-using-excel-vba.html# VBA does not offer a clipboard object, although Visual Basic 6 did. …. copies just two questions marks to the clipboard when used under Windows 8 and 10 (as tested in September 2015)

    April 2019 https://eileenslounge.com/viewtopic....249755#p249755 4 multiple Clipboard for multiple cells MISTAKE WRONG Yasser was right
    https://eileenslounge.com/viewtopic....249795#p249795 3

    Oct 2019 h tt ps://web.archive.org/web/20200806111619/ht tp s://social.msdn.microsoft.com/Forums/en-US/48e8c30c-24ee-458e-a873-a4e6e13f5926/dataobject-settext-and-putinclipboard-sequence-puts-invalid-data-hex-63-characters-in-clipboard?forum=isvvba

    Dec 2019 http://eileenslounge.com/viewtopic.php?p=262011#p262011 1
    Dec 2019 http://eileenslounge.com/viewtopic.php?f=18&t=33834 2 Clipboard quote multi line cell text Syntax in Windows clipboard, to Paste multi lines in Excel

    08/19/2020 h t tps://web.archive.org/web/20220922124033/h t tps://learn.microsoft.com/en-us/windows/win32/dataxchg/clipboard-formats Clipboard Formats


    Jan 2021 https://eileenslounge.com/viewtopic....279659#p279659 1 split clipboard

    Jun 2021 https://www.eileenslounge.com/viewto...295816#p295816 1
    https://www.eileenslounge.com/viewto...295780#p295780 2 put Text file in Excel Clipboard wonder

    Apr 2022 https://www.eileenslounge.com/viewto...294721#p294721 2 Clipboard Convert vertical to horizontal on multiple columns 26 Apr 2022 lost appendix

    Jun 2022 https://www.eileenslounge.com/viewto...296145#p296145 2 Power shell not working speakeasy Clipboard first 100 lines text file PowerShell Clipboard
    June 2022 https://www.eileenslounge.com/viewto...296126#p296126 3 PowerShell text set clipboard SpeakEasy works not me (snb CreateObject scripting.filesystemobject .opentextfile .readall )
    Last edited by DocAElstein; 03-29-2025 at 02:41 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

  2. #2
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10

    Dec 2022 https://www.eileenslounge.com/viewto...301534#p301534 2 Clipboard Trim Eval Range
    https://www.eileenslounge.com/viewto...301761#p301761 2 Hans knatsch

    Feb 2023 https://www.eileenslounge.com/viewto...304976#p304976 2 Do While Clipboard Gather unique values in one row for each unique key

    May 2023 https://www.eileenslounge.com/viewto...307826#p307826 2 clipboard ramble

    Jan 2023 https://www.eileenslounge.com/viewto...303007#p303007 2 Clipboard opps a vbCr & vbLf OopsAvbCr&vbLf.xls
    Jan 2023 https://www.eileenslounge.com/viewto...303039#p303039 2
    The .Copy method puts a copy of the object you are referencing onto the clipboard, in this case a Range.- and then synthesizes all the supported formats. including the Text format (which it does as the synthesized CF_TEXT format , which always ends CR LF [in fact it is even more clever than that, in that it actually separates Rows with CR LF and columns by Tab])
    The DataObject's .SetText method exposed to VBA, on the other hand, expects a straightforward text string
    The .Copy is going to tell the Clipboard that it …. ( it being VBA I think in this case, or possibly Excel as the controlling/"owning thing") …. this it is in charge of the clipboard for the time being. This it is a deferred render entry thing, but if and when it does actually put stuff in The ( Microsoft Windows ) Clipboard, then in the case of a range it is gonna be quite a few formats, (maybe about 30 ) or maybe not?: I mean, as its a deferred render entry thing it might decide to put different things in The ( Microsoft Windows ) Clipboard depending on what is done later to trigger the thing to do what it is deferring doing when it’s the controlling/ "owning thing" ?
    So that is maybe something close to what the .Copy is doing.
    .SetText and .PutInClipboard
    ( I am not sure if this is a deferred entry thing or not ? ).
    This can’t do anything much other than put text somewhere since that is all you give it: You give it a simple text string. That’s it.
    _.___________________________________________I am not 100% sure what you are saying by your reference synthesized CF_TEXT format.
    This is my guess as to what you are saying. :
    If I use the .GetFromClipboard and .GetText() from within VBA, then what I get will depend on what was the controlling "owning" thing of the The ( Microsoft Windows ) Clipboard at the time ….
    Let me consider the 2 cases relevant here…
    _ case1
    If .Copy was the owning controlling thing of The ( Microsoft Windows ) Clipboard, then, when it sees the request of .GetFromClipboard from within VBA, it may not quite have the format requested. ….I am trying to understand that link you gave ….. I will take a guess that what is going on in this case1 is this:
    It takes one of the formats on the first column from that link you gave which it does have* (*or will have – its deferred entry ....) . It than either makes one of the formats on the second column from that link, or maybe makes one that is not listed there. I don’t know. I do know, and agree with this bit that you said…. it actually separates Rows with CR LF and columns by Tab…..
    _ case2
    If the DataObject is the owning controlling thing of The ( Microsoft Windows ) Clipboard, ( in other words you did the .SetText and .PutInClipboard thing to put text in The ( Microsoft Windows ) Clipboard) , then …..you put a text in and you will get with the .GetFromClipboard and .GetText() the same text back. Simple as that. ( I am still not sure what of the CF_ things are used though in this case either )











    Clsid
    https://eileenslounge.com/viewtopic....314950#p314950 Mike GUID list CLSIDs skids SCIDs
    https://eileenslounge.com/viewtopic....289020#p289020 2 GUIDS CLSIDs in the { } as in CreateObject("New:" & “{aksjjfhaskj}” & "") Oct 2021
    https://eileenslounge.com/viewtopic....286708#p286708 3 CLSID .NET 3.5
    https://eileenslounge.com/viewtopic....289020#p289020 2 clsid Oct 2021 Feb 2016
    https://chandoo.org/forum/threads/cl...6/#post-223256



    API alternative
    2012 Looks like first report of it https://web.archive.org/web/20200806...d?forum=isvvba
    opened a support case with Microsoft as suggested by Kirk Beller…..MS determined the cause to be 'most likely a flaw in our product'. So far, I have had no notification of when or if it might be fixed - MS helped me develop a robust workaround using native Windows API calls instead of a DataObject. These are documented in the following articles:
    > http://msdn.microsoft.com/en-us/libr.../ff192913.aspx (How to: Send Information to the Clipboard); - Cant find on archive, but the original gets redirected to a new one from 2022, archived at similar date https://web.archive.org/web/20240421...-the-clipboard
    > http://msdn.microsoft.com/en-us/libr.../ff194373.aspx (How to: Retrieve Information from the Clipboard). – original archived
    2013 https://web.archive.org/web/20130113.../ff194373.aspx The original gets redirected to one from 2022 , archived at a similar date https://web.archive.org/web/20221203...-the-clipboard
    So far no MS article does the 64bit even though the original article has a post 2019 telling about it
    2015 https://www.spreadsheet1.com/how-to-...xcel-vba.html# VBA does not offer a clipboard object, although Visual Basic 6 did. …. copies just two questions marks to the clipboard when used under Windows 8 and 10 (as tested in September 2015)
    2015 https://wellsr.com/vba/2015/tutorial...d-paste-clear/ Mac as well like Rory’s 2018 Update: With the rollout of Windows 8 and Windows 10, this solution no longer works reliably,
    2018 https://web.archive.org/web/20191220...-the-clipboard difference between the DataObject and the Clipboard
    2018 https://chandoo.org/forum/threads/cl...6/#post-223256 Masterbasdor API Post
    Mar 2019 My last post is best, https://eileenslounge.com/viewtopic....247809#p247809 , giving further links
    Rory’s Tools https://eileenslounge.com/viewtopic....246708#p246708











    Some random links not looked at yet
    I don't have a Telekom anscluss
    <font color="#FFFFFF">EileensLongeCl...line.de</font>
    CumOnEileen.!*
    26 6 1945
    NS Storm Fuhrer - beruf großvaters
    015780900790 +4915780900790
    Passwort für E-Mail-Programme SendCum.!*
    Eileen CumHappy
    CumOnAbox971.!*
    Mar 2019 https://eileenslounge.com/viewtopic....247809#p247809 3 (Clipboard API alternative) array overflow date value Yasser rory
    Mar 2019 My last post is best, https://eileenslounge.com/viewtopic....247809#p247809 , giving further links
    Oct 2019 ht tps://social.msdn.microsoft.com/Forums/en-US/48e8c30c-24ee-458e-a873-a4e6e13f5926/dataobject-settext-and-putinclipboard-sequence-puts-invalid-data-hex-63-characters-in-clipboard?forum=isvvba not working so did archive org below which works
    htt ps://web.archive.org/web/20200806111619/h ttps://social.msdn.microsoft.com/Forums/en-US/48e8c30c-24ee-458e-a873-a4e6e13f5926/dataobject-settext-and-putinclipboard-sequence-puts-invalid-data-hex-63-characters-in-clipboard?forum=isvvba
    That seems to give > ht tp://msdn.microsoft.com/en-us/library/office/ff192913.aspx (How to: Send Information to the Clipboard); which is still as new but it is a redirect 2022 htt ps://learn.microsoft.com/en-us/office/vba/access/Concepts/Windows-API/send-information-to-the-clipboard there as new, and captures first start at Sep 2023 ??
    An old capture from Oct 2013 – htt ps://web.archive.org/web/20131003213600/http://msdn.microsoft.com/en-us/library/office/ff192913.aspx
    > htt p://msdn.microsoft.com/en-us/library/office/ff194373.aspx (How to: Retrieve Information from the Clipboard). Its dated 2022 currently as redirect htt ps://learn.microsoft.com/en-us/office/vba/access/Concepts/Windows-API/retrieve-information-from-the-clipboard
    A archive org from 2013 htt ps://web.archive.org/web/20130113075556/http://ms dn.microsoft.com/en-us/library/office/ff194373.aspx
    Maybe this was Rory’s cheat sheet from about 2015 ht tps://www.spreadsheet1.com/how-to-copy-strings-to-clipboard-using-excel-vba.html# VBA does not offer a clipboard object, although Visual Basic 6 did. …. copies just two questions marks to the clipboard when used under Windows 8 and 10 (as tested in September 2015)
    Rory’s Tools https://eileenslounge.com/viewtopic....246708#p246708
    Hans wrong https://www.eileenslounge.com/viewto...art=20#p246887








    docs.microsoft.com instead of learn.microsoft.com
    https://learn.microsoft.com/en-us/ar...3-a4e6e13f5926
    https://docs.microsoft.com/en-us/arc...3-a4e6e13f5926
    https://social.msdn.microsoft.com/Fo...d?forum=isvvba
    Last edited by DocAElstein; 03-29-2025 at 05:26 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

  3. #3
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    This is post #14
    https://www.excelfox.com/forum/showt...ll=1#post25008
    https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25008&viewfull=1#post25008
    https://www.excelfox.com/forum/showt...age2#post25008
    https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH/page2#post25008




    These notes are intended to bring together some "Clsid Clipboard" discussions from approximately here https://eileenslounge.com/viewtopic....288963#p288963 and here, https://eileenslounge.com/viewtopic....314925#p314925
    ( Just as a bit of time orientation as dates on posts don't mean much here, it would be the time period from about 1 – 4 years ago )

    Clsid Late Binding

    Talking vaguely , and not too accurately technically Speaking, about these sort of things:

    Something to do with the sadly mostly deceased / killed off Internet Explorer
    GetObject("new:{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}")

    MSForms.ListBox https://web.archive.org/web/20140610...emory-listbox/
    CreateObject("New:{8BD21D20-EC42-11CE-9E0D-00AA006002F3}")

    MSForms.DataObject https://web.archive.org/web/20140610...ms-dataobject/
    CreateObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")

    The last one is the most commonly used and known about, at least around the VBA area where I am, or have been, over the last few years

    I was curious to look into those things, amongst other reasons to see if there were any others and/ or a way to figure out if there was any way to get at any others, as well as the usual excitements and arousals got from looking up skirts and things that I probably shouldn’t .

    Some notes picked up from smarter people
    Mike (SpeakEasy), Hans, Chris : From about here https://eileenslounge.com/viewtopic....288963#p288963
    Microsoft simply hasn't exposed a class name for DataObject. Most object we use do have a class name. For those we can use early binding by setting a reference, or late binding by using GetObject/CreateObject with a class name. DataObject is an exception, so we MUST use its hexadecimal ClassID.
    36-character strings: .. It's the formal string representation of the underlying 128bit UUID (which Microsoft tend to refer to as a GUID; a CLSID is just a GUID being used for a specific role - identifying a class object), that representation being 32 hexadecimal digits separated by 4 hyphens ...
    We humans are sheltered from them normally, but there are odd occasions where we find we have to use them. Not very often for most users, it has to be said.

    Mike (SpeakEasy), from about here https://eileenslounge.com/viewtopic....314925#p314925
    GUID is just a unique identifier. Microsoft use unique identifiers for all sorts of purposes in Windows, and then they are given specific names to better indicate their purpose, hence FMTID in my previous post. The GUIDs you can use with CreateObject are actually knows as CLSIDs (or Class IDs); each and every class on Windows has it's own CLSID, and you can look them all up in the registry under HKEY_CLASSES_ROOT.
    In general it offers little benefit compared to using the ProgID (the human readable string, such as word.application), and indeed often obfuscates what is going on (malware writers were big fans ...).

    There are, however, a few rare scenarios where it can prove useful. Some COM objects do not have a ProgID. Often such objects are not directly useful to VB/VBA programmers, but some are. The one you use in your example, 1C3B4210-F441-11CE-B9EA-00AA006B1A69, is the userform clipboard object*, so we get a cheap way of simple clipboard access.
    ( * More accurately the userform dataobject, (Microsoft.Vbe.Interop.Forms.DataObjectClass - this is NOT a ProgID) which provides simple access to the clipboard )




    Here is a macro I found a few years back:

    Code:
    '                             This workbook kept and updated here:   (Folder at appBox.com excel fox2 excelfox2@gmail.com   RegistryCmdListsWinGimics)
    ' 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
    Sub ListCLSIDs() '  http://www.eileenslounge.com/viewtopic.php?f=26&t=22603&p=289007#p289007
    Dim Ws As Worksheet: Set Ws = Me ' Set Ws = ActiveSheet
    Dim Registry As Object, varKey As Variant, varKeys As Variant
     Set Registry = GetObject("winmgmts:\\.\root\default:StdRegProv")
     Registry.EnumKey 2147483650#, "SOFTWARE\Classes\CLSID", varKeys ' https://powershell.one/wmi/root/cimv2/stdregprov-EnumKey
    Dim Cnt As Long: Let Cnt = 1
        For Each varKey In varKeys
    '    Let Ws.Range("A" & Ws.Range("A" & Ws.Rows.Count & "").End(xlUp).Row + 1 & "").Value = varKey
     Let Cnt = Cnt + 1
        Let Ws.Range("A" & Cnt & "").Value = varKey
        Next
    End Sub
    Here is a more recent one from Mike ( Speakeasy https://eileenslounge.com/viewtopic....314941#p314941 )

    Code:
    Public Const HKEY_CLASSES_ROOT = &H80000000  '  https://eileenslounge.com/viewtopic.php?p=314945#p314945
    Public Sub GetCLSIDs_and_ProgIDs() '  https://eileenslounge.com/viewtopic.php?p=314941#p314941
    
        Dim entryArray() As Variant
        Dim KeyValue  As Variant  '  Dim KeyValue  As String  ..... Automation-errors-The-called-object-has-been-disconnected-from-the-clients - https://eileenslounge.com/viewtopic.php?p=314950#p314950    Mike: The 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   https://eileenslounge.com/viewtopic.php?p=314953#p314953
        Dim KeyPath As String
        Dim x As Long
        Dim row As Long
        
        Dim RegistryObject As Object
        Dim strComputer As String
        
        strComputer = "."
        Set RegistryObject = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
        RegistryObject.EnumKey HKEY_CLASSES_ROOT, "CLSID", entryArray
        
        ActiveSheet.Cells(1, 1).Value = "CLSID"
        ActiveSheet.Cells(1, 2).Value = "ProgID"
        
        row = 2
        For x = 0 To UBound(entryArray)
            RegistryObject.getstringvalue HKEY_CLASSES_ROOT, "CLSID\" & entryArray(x) & "\ProgId", "", KeyValue
            If KeyValue <> "" Then
                ActiveSheet.Cells(row, 1) = entryArray(x)
                ActiveSheet.Cells(row, 2) = KeyValue
                row = row + 1
            End If
        Next x
        
    End Sub
    
    In post #545 , ( #15 here ) I slightly rearrange those routines above, ( mine and Mike’s Clsid list thing making codings) , just to make them easier to compare, and then in post #547 , ( #17 here) I do Some initial comparison thoughts



    So at this point in the discursions here in this post, there is what look potentially two very similar codings, one got from me after eating too much Panzerschokolade a few years back, and the other from Mike. (I doubt the English piss bier he drinks helps like Panzerschokolade does me, rather I have a feeling he may be one of the last people on the planet knows a useful thing or two)
    But there is an important difference in the two: Both get the { curly bracket quid/Clsid stuff }, But he also gets a "ProgID" ????



    By the way, back then, partly as I only got the { curly bracket quid/Clsid stuff } , I did myself the coding below to create an object from the Clsid and then look at the TypeName( object ) . I did that as a geuss on how to get the class name, if it had one. More about that abortion Later
    Code:
    ' https://powershell.one/wmi/root/cimv2/stdregprov-EnumKey    '   https://www.vbforums.com/showthread.php?552899-Getting-all-sub-keys-from-a-registry-value
    Sub CLSIDsValueNames() '
    Dim Ws As Worksheet: Set Ws = Me ' Set Ws = ActiveSheet
    Dim RngSel As Range:  Set RngSel = Selection
        If RngSel.Cells.Count = 1 Then MsgBox prompt:="Please select at least 2 cells in column A": Exit Sub
        If RngSel.Cells.Columns.Count <> 1 Then MsgBox prompt:="Please select at least 2 cells in only column A": Exit Sub
        If Not RngSel.Cells.Column = 1 Then MsgBox prompt:="Please select at least 2 cells in column A": Exit Sub
    Dim stearCel As Range
        For Each stearCel In RngSel
         Let Ws.Range("B" & stearCel.row & "").Value = "Tried" ' To indicate I tried - this can be useful to see where it crashed
        Dim OOPObj  As Object
        On Error GoTo EyeEyeSkipper
         Set OOPObj = CreateObject("New:" & stearCel.Value & "")
         Let Ws.Range("D" & stearCel.row & "").Value = TypeName(OOPObj)
         Let Application.DisplayAlerts = False
         ThisWorkbook.Save ' This is done to save all got so far incase Excel crashes on next loop or below
         Let Application.DisplayAlerts = True
        On Error Resume Next
        OOPObj.Close
        On Error GoTo 0
        Set OOPObj = Nothing
    EyeEyeSkipper:
        On Error GoTo -1
        On Error GoTo 0
        Next stearCel
    End Sub
    
    Last edited by DocAElstein; 03-29-2025 at 11:09 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. ADS info via VBA 64bit
    By TML59 in forum Excel Help
    Replies: 9
    Last Post: 07-13-2024, 03:43 PM
  2. Replies: 26
    Last Post: 07-17-2013, 11:42 AM
  3. Office Version Independent Non-Activex Date Time Picker Using Form Controls
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 07-17-2013, 12:27 AM
  4. Info: different Value !
    By PcMax in forum Excel Help
    Replies: 2
    Last Post: 04-22-2012, 04:13 PM
  5. Version 2003 to 2007
    By PcMax in forum Excel Help
    Replies: 5
    Last Post: 11-23-2011, 07:52 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
  •