View Full Version : Version Info using VBA and registry quirks. InterRegional Settings GmbH
DocAElstein
09-16-2015, 03:25 PM
dlvköydv
DocAElstein
09-16-2015, 03:25 PM
Test test testies
Re: Appendix Thread. ( Codes for other Threads, HTML Tables, etc. )<o:p></o:p>
<o:p> </o:p>
Hi<o:p></o:p>
. I would like to use this Thread as an Appendix for codes in other Threads so as to help reduce clutter in that Thread should the code be a bit long, or not directly relevant.<o:p></o:p>
. Also as HTML code is on in this Test Sub Forum I would like to reference HTML Tables should I wish to use them in answering threads<o:p></o:p>
<o:p> </o:p>
@ Moderators, Administrator:<o:p></o:p>
. I hope the above is OK to do and if so please do not delete this Thread. ( Or advise if I should post my "Appendix" somewhere else ( If possible where HTML code is on ) )<o:p></o:p>
.<o:p></o:p>
. Many Thanks<o:p></o:p>
Alan<o:p></o:p>
This Post http://www.excelfox.com/forum/showthread.php/2824-Appendix-Thread-(-Codes-for-other-Threads-HTML-Tables-etc-)
http://www.excelfox.com/forum/showthread.php/2824-Appendix-Thread-(-Codes-for-other-Threads-HTML-Tables-etc-)
2824
https://eileenslounge.com/viewtopic.php?p=323184#p323184
https://eileenslounge.com/viewtopic.php?p=323144#p323144
https://www.youtube.com/watch?v=vXyMScSbhk4 (https://www.youtube.com/watch?v=vXyMScSbhk4)
https://www.youtube.com/watch?v=vXyMScSbhk4&lc=UgynOSp1dleo-Z8L_QN4AaABAg.9jJLDC1Z6L-9k68CuL4aTY (https://www.youtube.com/watch?v=vXyMScSbhk4&lc=UgynOSp1dleo-Z8L_QN4AaABAg.9jJLDC1Z6L-9k68CuL4aTY)
https://www.youtube.com/watch?v=vXyMScSbhk4&lc=UgwV5N_ulFXYMNbyQG54AaABAg.9itCkoVN4w79itOVYVvE wQ (https://www.youtube.com/watch?v=vXyMScSbhk4&lc=UgwV5N_ulFXYMNbyQG54AaABAg.9itCkoVN4w79itOVYVvE wQ)
https://www.youtube.com/watch?v=vXyMScSbhk4&lc=UgyOh-eR43LvlIJLG5p4AaABAg.9isnKJoRfbL9itPC-4uckb (https://www.youtube.com/watch?v=vXyMScSbhk4&lc=UgyOh-eR43LvlIJLG5p4AaABAg.9isnKJoRfbL9itPC-4uckb)
https://www.youtube.com/watch?v=vXyMScSbhk4&lc=Ugy1B1aQnHq2WbbucmR4AaABAg.9isY3Ezhx4j9itQLuif2 6T (https://www.youtube.com/watch?v=vXyMScSbhk4&lc=Ugy1B1aQnHq2WbbucmR4AaABAg.9isY3Ezhx4j9itQLuif2 6T)
https://www.youtube.com/watch?v=vXyMScSbhk4&lc=UgxxajSt03TX1wxh3IJ4AaABAg.9irSL7x4Moh9itTRqL7d Qh (https://www.youtube.com/watch?v=vXyMScSbhk4&lc=UgxxajSt03TX1wxh3IJ4AaABAg.9irSL7x4Moh9itTRqL7d Qh)
https://www.youtube.com/watch?v=vXyMScSbhk4&lc=Ugxa2VYHMWJWXA6QI294AaABAg.9irLgSdeU3r9itU7zdnW Hw (https://www.youtube.com/watch?v=vXyMScSbhk4&lc=Ugxa2VYHMWJWXA6QI294AaABAg.9irLgSdeU3r9itU7zdnW Hw)
https://www.youtube.com/watch?v=vXyMScSbhk4&lc=UgwJAAPbp8dhkW2X1Uh4AaABAg.9iraombnLDb9itV80HDp Xc (https://www.youtube.com/watch?v=vXyMScSbhk4&lc=UgwJAAPbp8dhkW2X1Uh4AaABAg.9iraombnLDb9itV80HDp Xc)
https://www.youtube.com/watch?v=vXyMScSbhk4&lc=UgzIzQ6MQ5kTpuLbIuB4AaABAg.9is0FSoF2Wi9itWKEvGS Sq (https://www.youtube.com/watch?v=vXyMScSbhk4&lc=UgzIzQ6MQ5kTpuLbIuB4AaABAg.9is0FSoF2Wi9itWKEvGS Sq)
DocAElstein
02-07-2018, 03:49 PM
Dumping Logs for support of this Thread Post:
http://www.excelfox.com/forum/showthread.php/2227-VBA-Input-Pop-up-Boxes-Application-InputBox-Method-versus-VBA-InputBox-Function?p=10476#post10476
Test Function used to produce the Log below
'Going a HoldYaBackCalledYaBackClapTrapRuc - Copy number_GlobinalCntChopsLog - a few copies of this are made and run. (Recursion)
'_-=Rem 4===================??? Got me hook lochprocedue in my code , 5 times simple run then another + 29 new copies of it are run = 5+30=35 times in total calling it it a few times http://www.excelfox.com/forum/showthread.php/1324-Loop-Through-Files-In-A-Folder-Using-VBA#post10421 .... wanking myself up and down a few times
Private Function HoldYaBackCalledYaBackClapTrapRuc(ByVal lMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long ' ByVal CopyNumberFroNxtLvl As Long) As Long
Let GlobinalCntChopsLog = GlobinalCntChopsLog + 1: Debug.Print " Going a HoldYaBackCalledYaBackClapTrapRuc"; GlobinalCntChopsLog; "(1Msg"; lMsg; ", wParam"; wParam; ", lParam"; lParam; ") Function Copy Number_"; GlobinalCntChopsLog
'If GlobinalCntChopsLog = 2 Then Let GlobinalCntChopsLog = GlobinalCntChopsLog - 1: UnHookWindowsHookCodEx hHookTrapCrapNumber: Exit Function
If lMsg = 5 Then '_-.... ( Hook type: HCBT_ACTIVATE = 5 but not here?) ... this runs a further 29 copies of HoldYaBackCalledYaBackClapTrap all coming here, so 30 times in total
Debug.Print "Expose Interface"; Tab(30); GlobinalCntChopsLog
SetWindowPosition wParam, 0, poX, pussY, 400, 150, 40 ' SWP_NOZORDER is 4 .. but not here?? 'SWP_NOSIZE + SWP_NOZORDER ' Pull the Chainge position ...
UnHookWindowsHookCodEx hHookTrapCrapNumber ' Release the Hook 30 times this is done
Else
Debug.Print "No InterOfCourse"; Tab(30); GlobinalCntChopsLog; Tab(50); hHookTrapCrapNumber
End If ' 5 times here then '_-....
Debug.Print "Wipe chain WRap"; Tab(30); GlobinalCntChopsLog; Tab(50); hHookTrapCrapNumber
Let HoldYaBackCalledYaBackClapTrapRuc = 0 ' Done 5+30=35 times in total '0 (or False) makes it work, all other numbers and I get no Message box
Let GlobinalCntChopsLog = GlobinalCntChopsLog - 1
End Function ' HoldYaBackCalledYaBackClapTrapRuc
---------------------------
MutsNuts AkaApi working ApplicationPromptToRangeInputBox
---------------------------
Select Range
---------------------------
OK
---------------------------
WndNumber 66770 HandleWndOfMyParent 983700 hWndDskTop 66204 hHookTrapCrapNumber
State of Much Such Penialtration's Number HookCodeXcretion's
================== AliAs Pull of my chain AliAs my long Hook
0
Going a HoldYaBackCalledYaBackClapTrapRuc 1 (1Msg 3 , wParam 2623104 , lParam 2353392 ) Function Copy Number_ 1
No InterOfCourse 1 276039693
Wipe chain WRap 1 276039693
Going a HoldYaBackCalledYaBackClapTrapRuc 1 (1Msg 3 , wParam 1377832 , lParam 2353500 ) Function Copy Number_ 1
No InterOfCourse 1 276039693
Wipe chain WRap 1 276039693
Going a HoldYaBackCalledYaBackClapTrapRuc 1 (1Msg 3 , wParam 3934358 , lParam 2353500 ) Function Copy Number_ 1
No InterOfCourse 1 276039693
Wipe chain WRap 1 276039693
Going a HoldYaBackCalledYaBackClapTrapRuc 1 (1Msg 3 , wParam 984706 , lParam 2353480 ) Function Copy Number_ 1
No InterOfCourse 1 276039693
Wipe chain WRap 1 276039693
Going a HoldYaBackCalledYaBackClapTrapRuc 1 (1Msg 9 , wParam 3934358 , lParam 66766 ) Function Copy Number_ 1
No InterOfCourse 1 276039693
Wipe chain WRap 1 276039693
Going a HoldYaBackCalledYaBackClapTrapRuc 1 (1Msg 5 , wParam 2623104 , lParam 2353812 ) Function Copy Number_ 1
Expose Interface 1
Going a HoldYaBackCalledYaBackClapTrapRuc 2 (1Msg 5 , wParam 2623104 , lParam 2353500 ) Function Copy Number_ 2
Expose Interface 2
Going a HoldYaBackCalledYaBackClapTrapRuc 3 (1Msg 5 , wParam 2623104 , lParam 2353188 ) Function Copy Number_ 3
Expose Interface 3
Going a HoldYaBackCalledYaBackClapTrapRuc 4 (1Msg 5 , wParam 2623104 , lParam 2352876 ) Function Copy Number_ 4
Expose Interface 4
Going a HoldYaBackCalledYaBackClapTrapRuc 5 (1Msg 5 , wParam 2623104 , lParam 2352564 ) Function Copy Number_ 5
Expose Interface 5
Going a HoldYaBackCalledYaBackClapTrapRuc 6 (1Msg 5 , wParam 2623104 , lParam 2352252 ) Function Copy Number_ 6
Expose Interface 6
Going a HoldYaBackCalledYaBackClapTrapRuc 7 (1Msg 5 , wParam 2623104 , lParam 2351940 ) Function Copy Number_ 7
Expose Interface 7
Going a HoldYaBackCalledYaBackClapTrapRuc 8 (1Msg 5 , wParam 2623104 , lParam 2351628 ) Function Copy Number_ 8
Expose Interface 8
Going a HoldYaBackCalledYaBackClapTrapRuc 9 (1Msg 5 , wParam 2623104 , lParam 2351316 ) Function Copy Number_ 9
Expose Interface 9
Going a HoldYaBackCalledYaBackClapTrapRuc 10 (1Msg 5 , wParam 2623104 , lParam 2351004 ) Function Copy Number_ 10
Expose Interface 10
Going a HoldYaBackCalledYaBackClapTrapRuc 11 (1Msg 5 , wParam 2623104 , lParam 2350692 ) Function Copy Number_ 11
Expose Interface 11
Going a HoldYaBackCalledYaBackClapTrapRuc 12 (1Msg 5 , wParam 2623104 , lParam 2350380 ) Function Copy Number_ 12
Expose Interface 12
Going a HoldYaBackCalledYaBackClapTrapRuc 13 (1Msg 5 , wParam 2623104 , lParam 2350068 ) Function Copy Number_ 13
Expose Interface 13
Going a HoldYaBackCalledYaBackClapTrapRuc 14 (1Msg 5 , wParam 2623104 , lParam 2349756 ) Function Copy Number_ 14
Expose Interface 14
Going a HoldYaBackCalledYaBackClapTrapRuc 15 (1Msg 5 , wParam 2623104 , lParam 2349444 ) Function Copy Number_ 15
Expose Interface 15
Going a HoldYaBackCalledYaBackClapTrapRuc 16 (1Msg 5 , wParam 2623104 , lParam 2349132 ) Function Copy Number_ 16
Expose Interface 16
Going a HoldYaBackCalledYaBackClapTrapRuc 17 (1Msg 5 , wParam 2623104 , lParam 2348820 ) Function Copy Number_ 17
Expose Interface 17
Going a HoldYaBackCalledYaBackClapTrapRuc 18 (1Msg 5 , wParam 2623104 , lParam 2348508 ) Function Copy Number_ 18
Expose Interface 18
Going a HoldYaBackCalledYaBackClapTrapRuc 19 (1Msg 5 , wParam 2623104 , lParam 2348196 ) Function Copy Number_ 19
Expose Interface 19
Going a HoldYaBackCalledYaBackClapTrapRuc 20 (1Msg 5 , wParam 2623104 , lParam 2347884 ) Function Copy Number_ 20
Expose Interface 20
Going a HoldYaBackCalledYaBackClapTrapRuc 21 (1Msg 5 , wParam 2623104 , lParam 2347572 ) Function Copy Number_ 21
Expose Interface 21
Going a HoldYaBackCalledYaBackClapTrapRuc 22 (1Msg 5 , wParam 2623104 , lParam 2347260 ) Function Copy Number_ 22
Expose Interface 22
Going a HoldYaBackCalledYaBackClapTrapRuc 23 (1Msg 5 , wParam 2623104 , lParam 2346948 ) Function Copy Number_ 23
Expose Interface 23
Going a HoldYaBackCalledYaBackClapTrapRuc 24 (1Msg 5 , wParam 2623104 , lParam 2346636 ) Function Copy Number_ 24
Expose Interface 24
Going a HoldYaBackCalledYaBackClapTrapRuc 25 (1Msg 5 , wParam 2623104 , lParam 2346324 ) Function Copy Number_ 25
Expose Interface 25
Going a HoldYaBackCalledYaBackClapTrapRuc 26 (1Msg 5 , wParam 2623104 , lParam 2346012 ) Function Copy Number_ 26
Expose Interface 26
Going a HoldYaBackCalledYaBackClapTrapRuc 27 (1Msg 5 , wParam 2623104 , lParam 2345700 ) Function Copy Number_ 27
Expose Interface 27
Going a HoldYaBackCalledYaBackClapTrapRuc 28 (1Msg 5 , wParam 2623104 , lParam 2345388 ) Function Copy Number_ 28
Expose Interface 28
Going a HoldYaBackCalledYaBackClapTrapRuc 29 (1Msg 5 , wParam 2623104 , lParam 2345076 ) Function Copy Number_ 29
Expose Interface 29
Going a HoldYaBackCalledYaBackClapTrapRuc 30 (1Msg 5 , wParam 2623104 , lParam 2344764 ) Function Copy Number_ 30
Expose Interface 30
Wipe chain WRap 30 276039693
Wipe chain WRap 29 276039693
Wipe chain WRap 28 276039693
Wipe chain WRap 27 276039693
Wipe chain WRap 26 276039693
Wipe chain WRap 25 276039693
Wipe chain WRap 24 276039693
Wipe chain WRap 23 276039693
Wipe chain WRap 22 276039693
Wipe chain WRap 21 276039693
Wipe chain WRap 20 276039693
Wipe chain WRap 19 276039693
Wipe chain WRap 18 276039693
Wipe chain WRap 17 276039693
Wipe chain WRap 16 276039693
Wipe chain WRap 15 276039693
Wipe chain WRap 14 276039693
Wipe chain WRap 13 276039693
Wipe chain WRap 12 276039693
Wipe chain WRap 11 276039693
Wipe chain WRap 10 276039693
Wipe chain WRap 9 276039693
Wipe chain WRap 8 276039693
Wipe chain WRap 7 276039693
Wipe chain WRap 6 276039693
Wipe chain WRap 5 276039693
Wipe chain WRap 4 276039693
Wipe chain WRap 3 276039693
Wipe chain WRap 2 276039693
Wipe chain WRap 1 276039693
_-.__________________________________
Windows Handleing Info:
' 1b) To hang in the Excel Window malking it effectively a Excel Msgbox... Normally if I did not do this ... don't do this .. that is to say leave it at 0 , specifically no window is 0 , and it "hanging in mid air so isn't even if it is imaginatively speaking
Public Declare Function FindWndNumber Lib "user32" Alias "FindWindowA" (Optional ByVal lpClassName As String, Optional ByVal lpWindowName As String) As Long
Dim HandleWndOfMyParent As Long ' I wanted to comment this 1b)(i) and ( 1b(ii) later ) out to leave it hanging in mid air in a virtual inadvirtual not thereness ... but somehow this complicated hook stuff does hang it somwhere but not in my Excel Window but I don't know what my parent's fart has to do with anything
' 1d) For some Misc experiments
Private Declare Function FindWindowExtremeNutty Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Dim WndNumber As Long, hWndDskTop As Long
Sub AkaApiApplicationPromptToRangeInputBox() ' This one works.. but HTF
' 1b(ii) This section is some how over written in / by the section part or some strange Addressing of HoldYaBackCalledYaBackClapTrap
Let WndNumber = FindWndNumber(lpClassName:=vbNullString, lpWindowName:=vbNullString)
Let HandleWndOfMyParent = FindWndNumber(lpClassName:="XLMAIN", lpWindowName:=vbNullString) ' This is a case where vbNullstring is important - that signifies that I am not giving it, which i do not have to. The second option is a bit flaky and does not often work. it certainly won't work if you make it "" as that is a specific string of zero. Null is a special idea in computing of not set yet / not defined - that is required if I do not want to give it
' 1d) Just some experiments, I forgot why as my brain has goine comfortably numb
Dim HeavyWindBreak As Long: Let HeavyWindBreak = HandleWndOfMyParent
Let hWndDskTop = FindWindowExtremeNutty(HandleWndOfMyParent, 0&, "XLDESK", vbNullString)
Debug.Print "WndNumber"; WndNumber; " HandleWndOfMyParent"; HandleWndOfMyParent; " hWndDskTop"; hWndDskTop; " hHookTrapCrapNumber"
Rem 3 Mess with me hook? God knows what this all does and it seems to make no difference if the proXYs poX or pussY are before or after SetWindowsHooksExample
DocAElstein
02-08-2018, 12:53 AM
Per PM request: One full working example of above code:
Option Explicit
Rem 1 ' This I understand. it is a simple more basic version of the VBA Message Box Function http://www.eileenslounge.com/viewtopic.php?f=18&t=28885#p223629
' 1a) UnWRap it and..
Private Declare Function APIssinUserDLL_MsgBox Lib "user32" Alias "MessageBoxA" (Optional ByVal HowManyFartsCanYouHandle As Long, Optional ByVal Prompt As String, Optional ByVal Title As String, Optional ByVal buttons As Long) As Long '
' 1b) To hang in the Excel Window malking it effectively a Excel Msgbox... Normally if I did not do this ... don't do this .. that is to say leave it at 0 , specifically no window is 0 , and it "hanging in mid air so isn't even if it is imaginatively speaking
Public Declare Function FindWndNumber Lib "user32" Alias "FindWindowA" (Optional ByVal lpClassName As String, Optional ByVal lpWindowName As String) As Long
Dim HandleWndOfMyParent As Long ' I wanted to comment this 1b)(i) and ( 1b(ii) later ) out to leave it hanging in mid air in a virtual inadvirtual not thereness ... but somehow this complicated hook stuff does hang it somwhere but not in my Excel Window but I don't know what my parent's fart has to do with anything
' 1d) For some Misc experiments
Private Declare Function FindWindowExtremeNutty Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Dim WndNumber As Long, hWndDskTop As Long
Dim Booloks As Boolean
'_-_._______________________________________________-
'_-=================??? main Declarations that I don't really understand
Rem 2 Position my box --- From here on I do not really have a clue
' 2(a) This will tie something on the chain for when you pull it https://msdn.microsoft.com/en-us/library/windows/desktop/ms644990(v=vs.85).aspx
Private Declare Function SetWindowsHooksExample Lib "user32" Alias "SetWindowsHookExA" (ByVal Hooktype As Long, ByVal lokprocedureAddress As Long, Optional ByVal hmod As Long, Optional ByVal dwThreadId As Long) As Long
' 2(b) Wipe the chain clean
Private Declare Function UnHookWindowsHookCodEx Lib "user32" Alias "UnhookWindowsHookEx" (ByVal hHookTrapCrapNumber As Long) As Long
' 2(c) Don't loose the Thread? - This seems to have no effect , - maybe it would if something else was going on at the time. You don't want to loose the Thread I guess
'Public Declare Function GetCurrentThreadId Lib "kernel32" () As Long ' Effectively long Null acttuall not ?? -
Public Declare Function GetCurrentFredId Lib "kernel32" Alias "GetCurrentThreadId" () As Long ' Effectively long Null acttuall not ?? -
' 2(d) This looks understandable almost, z(0 for top), posLeft, posTop, x pixels, y pixels,
Private Declare Function SetWindowPosition Lib "user32" Alias "SetWindowPos" (ByVal hWnd As Long, ByVal zNumber As Long, ByVal CoedX As Long, ByVal CoedY As Long, ByVal xPiXel As Long, ByVal yPiYel As Long, ByVal wFlags As Long) As Long
' 2e)
Private hHookTrapCrapNumber As Long ' Handle to the Hook procedure
' 2f)
Private poX As Long: Private pussY As Long ' Positional By proXYs
Dim GlobinalCntChopsLog As Long ' Only used in this test code to keep track of the copies of a Function(HoldYaBackCalledYaBackClapTrap) used in a recursion process
' 2g) bits to do with 1 that i am resonably happy with
Sub AkaApiApplicationPromptToRangeInputBox() ' This one works.. but HTF
' 1b(ii) This section is some how over written in / by the section part or some strange Addressing of HoldYaBackCalledYaBackClapTrap
Let WndNumber = FindWndNumber(lpClassName:=vbNullString, lpWindowName:=vbNullString)
Let HandleWndOfMyParent = FindWndNumber(lpClassName:="XLMAIN", lpWindowName:=vbNullString) ' This is a case where vbNullstring is important - that signifies that I am not giving it, which i do not have to. The second option is a bit flaky and does not often work. it certainly won't work if you make it "" as that is a specific string of zero. Null is a special idea in computing of not set yet / not defined - that is required if I do not want to give it
' 1d) Just some experiments, I forgot why as my brain has goine comfortably numb
Dim HeavyWindBreak As Long: Let HeavyWindBreak = HandleWndOfMyParent
Let hWndDskTop = FindWindowExtremeNutty(HandleWndOfMyParent, 0&, "XLDESK", vbNullString)
Debug.Print "WndNumber"; WndNumber; " HandleWndOfMyParent"; HandleWndOfMyParent; " hWndDskTop"; hWndDskTop; " hHookTrapCrapNumber"
Rem 3 Mess with me hook? God knows what this all does and it seems to make no difference if the proXYs poX or pussY are before or after SetWindowsHooksExample
Debug.Print "State of Much Such"; Tab(20); "Penialtration's Number"; Tab(45); "HookCodeXcretion's"
Debug.Print "=================="; Tab(20); "AliAs Pull of my chain"; Tab(45); "AliAs my long Hook"
Let GlobinalCntChopsLog = 0:
'_-======================== Weird thing with an AddressOf ???
Let poX = 10: pussY = 50 ' These can go before or after the next line, makes no diffference.. - I bet no Pro noticed that...
'Let hHookTrapCrapNumber = SetWindowsHooksExample(5, AddressOf HoldYaBackCalledYaBackClapTrap, 0, GetCurrentThreadId) ' (5-pull before flush, somehow arranges that the function gets called ,
Debug.Print ; Tab(75); hHookTrapCrapNumber ' 'APIssinUserDLL_MsgBox HeavyWindBreak, "Excel MsgBox", "This is Center Position", vbOKOnly ' This breaks Wnd in Excel Window
Call HookAPIssinUserDLL_MsgBoxThenDropIt
'APIssinUserDLL_MsgBox &H0, "Select Range", "MutsNuts AkaApi working ApplicationPromptToRangeInputBox", vbOKOnly ' Pseudo Non Modal
'APIssinUserDLL_MsgBox &H0, "Select Range", "MutsNuts AkaApi working ApplicationPromptToRangeInputBox", vbOKOnly ' Pseudo Non Modal
'HookAPIssinUserDLL_MsgBoxThenDropIt
Dim Rng As Range: Set Rng = Selection
' (Optional ByVal hwnd As Long, Optional ByVal Prompt As String, Optional ByVal Title As String, Optional ByVal buttons As Long) As Long '
End Sub ' AkaApiApplicationPromptToRangeInputBox
Sub HookAPIssinUserDLL_MsgBoxThenDropIt()
Sub HookAPIssinUserDLL_MsgBoxThenDropIt()
' a) HOOK Hook the pseudo Windows Sub Class Function WinSubWinCls_JerkBackOffHooKerd
Dim BookMarkClassTeachMeWind As Long: Let BookMarkClassTeachMeWind = 5
'Let hHookTrapCrapNumber = SetWindowsHooksExample(BookMarkClassTeachMeWind, AddressOf HoldYaBackCalledYaBackClapTraped, 0, GetCurrentThreadId) ' (5-pull before flush, somehow arranges that the function gets called ,
'Let hHookTrapCrapNumber = SetWindowsHooksExample(BookMarkClassTeachMeWind, AddressOf HoldYaBackCalledYaBackClapTrapRuc, 0, GetCurrentThreadId) ' (5-pull before flush, somehow arranges that the function gets called ,
Let hHookTrapCrapNumber = SetWindowsHooksExample(BookMarkClassTeachMeWind, AddressOf HoldYaBackCalledYaBackClapTrapRuc, 0, GetCurrentFredId) ' (5-pull before flush, somehow arranges that the function gets called ,
' b) Call the MessageBoxA
APIssinUserDLL_MsgBox &H0, "Select Range", "MutsNuts AkaApi working ApplicationPromptToRangeInputBox", vbOKOnly ' Pseudo Non Modal
End Sub
'_-=Rem 4===================??? Got me hook lochprocedue in my code , 5 times simple run then another + 29 new copies of it are run = 6+29=35 times in total calling it it a few times http://www.excelfox.com/forum/showthread.php/1324-Loop-Through-Files-In-A-Folder-Using-VBA#post10421 .... wanking myself up and down a few times
'_-=Rem 4===================??? Got me hook lochprocedue in my code , 5 times simple run then another + 29 new copies of it are run = 5+30=35 times in total calling it it a few times http://www.excelfox.com/forum/showthread.php/1324-Loop-Through-Files-In-A-Folder-Using-VBA#post10421 .... wanking myself up and down a few times
Private Function HoldYaBackCalledYaBackClapTrapRuc(ByVal lMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long ' ByVal CopyNumberFroNxtLvl As Long) As Long
Let GlobinalCntChopsLog = GlobinalCntChopsLog + 1: Debug.Print " Going a HoldYaBackCalledYaBackClapTrapRuc"; GlobinalCntChopsLog; "(1Msg"; lMsg; ", wParam"; wParam; ", lParam"; lParam; ") Function Copy Number_"; GlobinalCntChopsLog
'If GlobinalCntChopsLog = 2 Then Let GlobinalCntChopsLog = GlobinalCntChopsLog - 1: UnHookWindowsHookCodEx hHookTrapCrapNumber: Exit Function
If lMsg = 5 Then '_-.... ( Hook type: HCBT_ACTIVATE = 5 but not here?) ... this runs a further 29 copies of HoldYaBackCalledYaBackClapTrap all coming here, so 30 times in total
Debug.Print "Expose Interface"; Tab(30); GlobinalCntChopsLog
Call SetWindowPosition(wParam, 0, poX, pussY, 400, 150, 40) ' SWP_NOZORDER is 4 .. but not here?? 'SWP_NOSIZE + SWP_NOZORDER ' Pull the Chainge position ...
UnHookWindowsHookCodEx hHookTrapCrapNumber ' Release the Hook 30 times this is done
Else
Debug.Print "No InterOfCourse"; Tab(30); GlobinalCntChopsLog; Tab(50); hHookTrapCrapNumber
End If ' 5 times here then '_-....
Debug.Print "Wipe chain WRap"; Tab(30); GlobinalCntChopsLog; Tab(50); hHookTrapCrapNumber
Let HoldYaBackCalledYaBackClapTrapRuc = 0 ' Done 5+30=35 times in total '0 (or False) makes it work, all other numbers and I get no Message box
Let GlobinalCntChopsLog = GlobinalCntChopsLog - 1
End Function ' HoldYaBackCalledYaBackClapTrapRuc
DocAElstein
02-17-2018, 05:06 PM
Code for this Thread:
http://www.excelfox.com/forum/showthread.php/2232-Excel-VBA-comma-point-thousand-decimal-separator-number-problem?p=10503#post10503
http://www.excelfox.com/forum/forumdisplay.php/13-Excel-Tips-and-Tricks
Function CStrSepDbl
'10 ' http://www.eileenslounge.com/viewtopic.php?f=27&t=22850#p208624
Function CStrSepDbl(Optional ByVal strNumber As String) As Double ' Return a Double based on a String Input which is asssumed to "Look" like a Number. The code will work for Leading and Trailing zeros, but will not return them. )
20 Rem 0 At the Dim stage a '_-String is "Pointer" to a "Blue Print" (or Form, Questionaire not yet filled in, a template etc.)"Pigeon Hole" in Memory, sufficient in construction to house a piece of Paper with code text giving the relevant information for the particular Variable Type. VBA is sent to it when it passes it. In a Routine it may be given a particular “Value”, or (“Values” for Objects). There instructions say then how to do that and handle(store) that(those). At Dim the created Paper is like a Blue Print that has some empty spaces not yet filled in. A String is a bit tricky. The Blue Print code line Paper in the Pigeon Hole will allow to note the string Length and an Initial start memory Location. This Location well have to change frequently as strings of different length are assigned. Instructiions will tell how to do this. Theoretically a specilal value vbNullString is set to aid in quich checks, But http://www.mrexcel.com/forum/excel-questions/361246-vbnullstring-2.html#post44116
30 If StrPtr(strNumber) = 0 Then Let CStrSepDbl = "9999999999": Exit Function '_- StrPtr(MyVaraibleNotYetUsed)=0 .. http://www.excelfox.com/forum/showthread.php/1828-How-To-React-To-The-Cancel-Button-in-a-VB-(not-Application)-InputBox?p=10463#post10463 https://www.mrexcel.com/forum/excel-questions/35206-test-inputbox-cancel-2.html?highlight=strptr#post2845398 https://www.mrexcel.com/forum/excel-questions/917689-passing-array-class-byval-byref.html#post4412382
40 Rem 1 'Adding a leading zero if no number before a comma or point, change all seperators to comma ,
50 If VBA.Strings.Left$(strNumber, 1) = "," Or VBA.Strings.Left$(strNumber, 1) = "." Then Let strNumber = "0" & strNumber ' case for like .12 or ,7 etc 'VBA Strings collection Left function returns a Variant- initially tries to coerces the first parameter into Variant, Left$ does not, that's why Left$ is preferable over Left, it's theoretically slightly more efficient, as it avoids the overhead/inefficieny associated with the Variant. It allows a Null to be returned if a Null is given. https://www.excelforum.com/excel-new...ml#post4084816 .. it is all to do with ya .."Null propagation".. maties ;) '_-.. http://allenbrowne.com/casu-12.html Null is a special "I do not know, / answer unknown" - handy to hav... propogetion wonks - math things like = 1+2+Null returns you null. Or string manipulation stuff like, left(Null returns you Null. Count things like Cnt (x,y,Null) will return 2 - there are two known things there..Hmm -bit iffy although you could argue that Null has not been entered yet..may never
60 If VBA.Strings.Left$(strNumber, 2) = "-," Or VBA.Strings.Left$(strNumber, 2) = "-." Then Let strNumber = Application.WorksheetFunction.Replace(strNumber, 1, 1, "-0") ' case for like -.12 or -,274 etc
70 Let strNumber = Replace(strNumber, ".", ",", 1, -1, vbBinaryCompare) 'Replace at start any . to a , After this point there should be either no or any amount of ,
80 'Check If a Seperator is present, then MAIN CODE is done
90 If InStr(1, strNumber, ",") > 0 Then 'Check we have at least one seperator, case we have, then..
100 Rem 2 'MAIN CODE part ====
110 'Length of String: Position of last ( Decimal ) Seperator
120 Dim LenstrNumber As Long: Let LenstrNumber = Len(strNumber): Dim posDecSep As Long: Let posDecSep = VBA.Strings.InStrRev(strNumber, ",", LenstrNumber) ' from right the positom "along" from left ( (in strNumber) , for a (",") , starting at the ( Last character ) which BTW. is the default
130 'Whole Number Part
140 Dim strHlNumber As String: Let strHlNumber = VBA.Strings.Left$(strNumber, (posDecSep - 1))
150 Let strHlNumber = Replace(strHlNumber, ",", Empty, 1, -1) 'In (strHlNumber) , I look for a (",") , and replace it with "VBA Nothing there" , considering and returning the strNumber from the start of the string , and replace all occurances ( -1 ).
160 Dim HlNumber As Long: Let HlNumber = CLng(strHlNumber) 'Long Number is a Whole Number, no fractional Part
170 'Fraction Part of Number
180 Dim strFrction As String: Let strFrction = VBA.Strings.Mid$(strNumber, (posDecSep + 1), (LenstrNumber - posDecSep)) 'Part of string (strNumber ) , starting from just after Decimal separator , and extending to a length of = ( the length of the whole strNumber minus the position of the separator )
190 Dim LenstrFrction As Long: Let LenstrFrction = Len(strFrction) 'Digits after Seperator. This must be done at the String Stage, as length of Long, Double etc will allways be 8, I think?.
200 Dim Frction As Double: Let Frction = CDbl(strFrction) 'This will convert to a Whole Double Number. Double Number can have Fractional part
210 Let Frction = Frction * 1 / (10 ^ (LenstrFrction)) 'Use 1/___, rather than a x 0.1 or 0,1 so as not to add another , . uncertainty!!
220 'Re join, using Maths to hopefully get correct Final Value
230 Dim DblReturn As Double 'Double Number to be returned in required Format after maniplulation.
240 If Left(strHlNumber, 1) <> "-" Then 'Case positive number
250 Let DblReturn = CDbl(HlNumber) + Frction 'Hopefully a simple Mathematics + will give the correct Double Number back
260 Else 'Case -ve Number
270 Let strHlNumber = Replace(strHlNumber, "-", "", 1, 1, vbBinaryCompare) ' strHlNumber * (-1) ' "Remove" -ve sign
280 Let DblReturn = (-1) * (CDbl(strHlNumber) + Frction) 'having constructed the value of the final Number we multiply by -1 to put the Minus sign back
290 End If 'End checking polarity.
300 'Final Code Line(s) At this point we have what we want. We need to place this in the "Double Type variable" , CStrSepDbl , so that an assinment like = CStrSepDbl( ) will return this final value
310 Let CStrSepDbl = DblReturn 'Final Double value to be returned by Function
320 Else 'End MAIN CODE. === We came here if we have a Whole Number with no seperator, case no seperator
330 'Simple conversion of a string "Number" with no Decimal Seperator to Double Format
340 Let CStrSepDbl = CDbl(strNumber) 'String to be returned by Function is here just a simple convert to Double ' I guess this will convert a zero length string "" to 0 also
350 End If 'End checking for if a Seperator is present.
End Function
'Long code lines: Referrences http://www.mrexcel.com/forum/about-board/830361-board-wish-list-2.html http://www.mrexcel.com/forum/test-here/928092-http://www.eileenslounge.com/viewtopic.php?f=27&t=22850
Function CStrSepDblshg(strNumber As String) As Double ' http://excelxor.com/2014/09/05/index-returning-an-array-of-values/ http://www.techonthenet.com/excel/formulas/split.php
5 If Left(strNumber, 1) = "," Or Left(strNumber, 1) = "." Then Let strNumber = "0" & strNumber
20 Let strNumber = Replace(strNumber, ".", ",", 1, -1)
40 If InStr(1, strNumber, ",") > 0 Then
170 If Left(Replace(Left(strNumber, (InStrRev(strNumber, ",", Len(strNumber)) - 1)), ",", Empty, 1, 1), 1) <> "-" Then
180 Let CStrSepDblshg = CDbl(CLng(Replace(Left(strNumber, (InStrRev(strNumber, ",", Len(strNumber)) - 1)), ",", Empty, 1, 1))) + CDbl(Mid(strNumber, (InStrRev(strNumber, ",", Len(strNumber)) + 1), (Len(strNumber) - InStrRev(strNumber, ",", Len(strNumber))))) * 1 / (10 ^ (Len(Mid(strNumber, (InStrRev(strNumber, ",", Len(strNumber)) + 1), (Len(strNumber) - InStrRev(strNumber, ",", Len(strNumber)))))))
190 Else
210 Let CStrSepDblshg = (-1) * (CDbl(Replace(Left(strNumber, (InStrRev(strNumber, ",", Len(strNumber)) - 1)), ",", Empty, 1, 1) * (-1)) + CDbl(Mid(strNumber, (InStrRev(strNumber, ",", Len(strNumber)) + 1), (Len(strNumber) - InStrRev(strNumber, ",", Len(strNumber))))) * 1 / (10 ^ (Len(Mid(strNumber, (InStrRev(strNumber, ",", Len(strNumber)) + 1), (Len(strNumber) - InStrRev(strNumber, ",", Len(strNumber))))))))
220 End If
250 Else
270 Let CStrSepDblshg = CDbl(strNumber)
280 End If
End Function
Demo Code to call Function
Sub TestieCStrSepDbl() ' using adeptly named TabulatorSyncranartor ' / Introducing LSet TabulatorSyncranartor Statement : http://www.excelfox.com/forum/showthread.php/2230-Built-in-VBA-methods-and-functions-to-alter-the-contents-of-existing-character-strings
Dim LooksLikeANumber(1 To 17) As String
Let LooksLikeANumber(1) = "001,456"
Let LooksLikeANumber(2) = "1.0007"
Let LooksLikeANumber(3) = "123,456.2"
Let LooksLikeANumber(4) = "0023.345,0"
Let LooksLikeANumber(5) = "-0023.345,0"
Let LooksLikeANumber(6) = "1.007"
Let LooksLikeANumber(7) = "1.3456"
Let LooksLikeANumber(8) = "1,2345"
Let LooksLikeANumber(9) = "01,0700000"
Let LooksLikeANumber(10) = "1.3456"
Let LooksLikeANumber(11) = "1,2345"
Let LooksLikeANumber(12) = ".2345"
Let LooksLikeANumber(13) = ",4567"
Let LooksLikeANumber(14) = "-,340"
Let LooksLikeANumber(15) = "00.04"
Let LooksLikeANumber(16) = "-0,56000000"
Let LooksLikeANumber(17) = "-,56000001"
Dim Stear As Variant, MyStringsOut As String
For Each Stear In LooksLikeANumber()
Dim Retn As Double
Let Retn = CStrSepDbl(Stear)
Dim TabulatorSyncranartor As String: Let TabulatorSyncranartor = " "
LSet TabulatorSyncranartor = Stear
Let MyStringsOut = MyStringsOut & TabulatorSyncranartor & Retn & vbCrLf
Debug.Print Stear; Tab(15); Retn
Next Stear
MsgBox MyStringsOut
End Sub
Code also Here:
https://pastebin.com/1kq6h9Bn
DocAElstein
02-23-2018, 03:16 PM
sölcjslkjcslkjc
https://eileenslounge.com/viewtopic.php?p=323184#p323184
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA (https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA)
https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgxesLhWNr_zNP0GUdh4AaABAg.9hI1CQJMLLo9hWn2pGBe SS (https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgxesLhWNr_zNP0GUdh4AaABAg.9hI1CQJMLLo9hWn2pGBe SS)
https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgzkRujoMw9PblmXDQ14AaABAg.9hJRnEjxQrd9hJoCjomN I2 (https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgzkRujoMw9PblmXDQ14AaABAg.9hJRnEjxQrd9hJoCjomN I2)
https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgzPZbG7OvUkh35nXDd4AaABAg.9hJOZEEZa6p9hJqLC7El-w (https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgzPZbG7OvUkh35nXDd4AaABAg.9hJOZEEZa6p9hJqLC7El-w)
https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgwUcEpm8u6ZW3uOHXx4AaABAg.9hIlxxGY7t49hJsB2PWx C4 (https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgwUcEpm8u6ZW3uOHXx4AaABAg.9hIlxxGY7t49hJsB2PWx C4)
https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgyvDj6NWT1Gxyy2JyR4AaABAg.9hIKlNPeqDn9hJskm92n p6 (https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgyvDj6NWT1Gxyy2JyR4AaABAg.9hIKlNPeqDn9hJskm92n p6)
https://www.youtube.com/watch?v=pkhazgI3LAo&lc=Ugwy7qx_kG9iUmMVO_F4AaABAg.9hI2IGUdmTW9hJuyaQaw qx (https://www.youtube.com/watch?v=pkhazgI3LAo&lc=Ugwy7qx_kG9iUmMVO_F4AaABAg.9hI2IGUdmTW9hJuyaQaw qx)
https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgxesLhWNr_zNP0GUdh4AaABAg.9hI1CQJMLLo9hJwTB9Jl ob (https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgxesLhWNr_zNP0GUdh4AaABAg.9hI1CQJMLLo9hJwTB9Jl ob)
https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgyyQWYVP1OnCqavb-x4AaABAg (https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgyyQWYVP1OnCqavb-x4AaABAg)
https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgwJKKmExZ1FdZVDJf54AaABAg (https://www.youtube.com/watch?v=pkhazgI3LAo&lc=UgwJKKmExZ1FdZVDJf54AaABAg)
https://www.youtube.com/watch?v=pkhazgI3LAo&lc=Ugz_p0kVGrLntPtYzCt4AaABAg (https://www.youtube.com/watch?v=pkhazgI3LAo&lc=Ugz_p0kVGrLntPtYzCt4AaABAg)
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA (https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA)https://eileenslounge.com/viewtopic.php?p=323184#p323184
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA (https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA)
http://www.eileenslounge.com/viewtopic.php?f=30&t=41784 (http://www.eileenslounge.com/viewtopic.php?f=30&t=41784)
http://www.eileenslounge.com/viewtopic.php?p=323966#p323966 (http://www.eileenslounge.com/viewtopic.php?p=323966#p323966)
http://www.eileenslounge.com/viewtopic.php?p=323959#p323959 (http://www.eileenslounge.com/viewtopic.php?p=323959#p323959)
http://www.eileenslounge.com/viewtopic.php?p=323960#p323960 (http://www.eileenslounge.com/viewtopic.php?p=323960#p323960)
http://www.eileenslounge.com/viewtopic.php?p=323894#p323894 (http://www.eileenslounge.com/viewtopic.php?p=323894#p323894)
http://www.eileenslounge.com/viewtopic.php?p=323843#p323843 (http://www.eileenslounge.com/viewtopic.php?p=323843#p323843)
https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABa6BSa17 3Z (https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABa6BSa17 3Z)
https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABa6-64Xpgl (https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABa6-64Xpgl)
https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABa5ms39y jd (https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABa5ms39y jd)
https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABa5ZXJwR CM (https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABa5ZXJwR CM)
https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABa4Pr15N Ut (https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABa4Pr15N Ut)
https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABa4I83Je lY (https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABa4I83Je lY)
https://www.youtube.com/watch?v=C43btudYyzA&lc=Ugyf349Ue6_4umFfNUB4AaABAg.8mjgPNoTt_HABa3tnAjh ZU (https://www.youtube.com/watch?v=C43btudYyzA&lc=Ugyf349Ue6_4umFfNUB4AaABAg.8mjgPNoTt_HABa3tnAjh ZU)
https://www.youtube.com/watch?v=C43btudYyzA&lc=Ugyf349Ue6_4umFfNUB4AaABAg.8mjgPNoTt_HABa3KswxL 3c (https://www.youtube.com/watch?v=C43btudYyzA&lc=Ugyf349Ue6_4umFfNUB4AaABAg.8mjgPNoTt_HABa3KswxL 3c)
https://www.youtube.com/watch?v=suUqEo3QWus&lc=UgyBXFxnVWT3pqtdqPx4AaABAg (https://www.youtube.com/watch?v=suUqEo3QWus&lc=UgyBXFxnVWT3pqtdqPx4AaABAg)
https://www.youtube.com/watch?v=suUqEo3QWus&lc=Ugi53h84LUm5bHgCoAEC.7-H0Z7-COoGABZFQ8vjEvY (https://www.youtube.com/watch?v=suUqEo3QWus&lc=Ugi53h84LUm5bHgCoAEC.7-H0Z7-COoGABZFQ8vjEvY)
https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABZ8N9O-O8p (https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABZ8N9O-O8p)
http://www.eileenslounge.com/viewtopic.php?p=323547#p323547 (http://www.eileenslounge.com/viewtopic.php?p=323547#p323547)
http://www.eileenslounge.com/viewtopic.php?p=323516#p323516 (http://www.eileenslounge.com/viewtopic.php?p=323516#p323516)
http://www.eileenslounge.com/viewtopic.php?p=323517#p323517 (http://www.eileenslounge.com/viewtopic.php?p=323517#p323517)
http://www.eileenslounge.com/viewtopic.php?p=323449#p323449 (http://www.eileenslounge.com/viewtopic.php?p=323449#p323449)
http://www.eileenslounge.com/viewtopic.php?p=323226#p323226 (http://www.eileenslounge.com/viewtopic.php?p=323226#p323226)
http://www.eileenslounge.com/viewtopic.php?f=25&t=41702&p=323150#p323150 (http://www.eileenslounge.com/viewtopic.php?f=25&t=41702&p=323150#p323150)
http://www.eileenslounge.com/viewtopic.php?p=323085#p323085 (http://www.eileenslounge.com/viewtopic.php?p=323085#p323085)
http://www.eileenslounge.com/viewtopic.php?p=322955#p322955 (http://www.eileenslounge.com/viewtopic.php?p=322955#p322955)
http://www.eileenslounge.com/viewtopic.php?f=30&t=41659 (http://www.eileenslounge.com/viewtopic.php?f=30&t=41659)
https://www.youtube.com/watch?v=suUqEo3QWus&lc=Ugi53h84LUm5bHgCoAEC.7-H0Z7-COoGABZFQ8vjEvY (https://www.youtube.com/watch?v=suUqEo3QWus&lc=Ugi53h84LUm5bHgCoAEC.7-H0Z7-COoGABZFQ8vjEvY)
https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABZ8N9O-O8p (https://www.youtube.com/watch?v=3t8Mk4URi6g&lc=UgzoakhRXOsCaoRm_Nd4AaABAg.8xzeMdC8IOGABZ8N9O-O8p)
https://www.youtube.com/watch?v=C43btudYyzA&lc=UgxREWxgx2z2Lza_0st4AaABAg (https://www.youtube.com/watch?v=C43btudYyzA&lc=UgxREWxgx2z2Lza_0st4AaABAg)
https://www.youtube.com/watch?v=C43btudYyzA&lc=UgyikSWvlxbWS24NBeR4AaABAg (https://www.youtube.com/watch?v=C43btudYyzA&lc=UgyikSWvlxbWS24NBeR4AaABAg)
https://www.youtube.com/watch?v=C43btudYyzA&lc=UgwNiH4hhyrd2UjDK8d4AaABAg (https://www.youtube.com/watch?v=C43btudYyzA&lc=UgwNiH4hhyrd2UjDK8d4AaABAg)
https://www.youtube.com/watch?v=C43btudYyzA&lc=Ugyf349Ue6_4umFfNUB4AaABAg.8mjgPNoTt_HAAf952WoU ti (https://www.youtube.com/watch?v=C43btudYyzA&lc=Ugyf349Ue6_4umFfNUB4AaABAg.8mjgPNoTt_HAAf952WoU ti)
https://www.youtube.com/watch?v=hz4vb48wzMM&lc=Ugy2N3gvXBNrvWpojqR4AaABAg (https://www.youtube.com/watch?v=hz4vb48wzMM&lc=Ugy2N3gvXBNrvWpojqR4AaABAg)
http://www.eileenslounge.com/viewtopic.php?p=322462#p322462 (http://www.eileenslounge.com/viewtopic.php?p=322462#p322462)
http://www.eileenslounge.com/viewtopic.php?p=322356#p322356 (http://www.eileenslounge.com/viewtopic.php?p=322356#p322356)
http://www.eileenslounge.com/viewtopic.php?p=321984#p321984 (http://www.eileenslounge.com/viewtopic.php?p=321984#p321984)
https://eileenslounge.com/viewtopic.php?f=30&t=41610 (https://eileenslounge.com/viewtopic.php?f=30&t=41610)
https://eileenslounge.com/viewtopic.php?p=322176#p322176 (https://eileenslounge.com/viewtopic.php?p=322176#p322176)
https://eileenslounge.com/viewtopic.php?p=322238#p322238 (https://eileenslounge.com/viewtopic.php?p=322238#p322238)
https://eileenslounge.com/viewtopic.php?p=322270#p322270 (https://eileenslounge.com/viewtopic.php?p=322270#p322270)
https://eileenslounge.com/viewtopic.php?p=322300#p322300 (https://eileenslounge.com/viewtopic.php?p=322300#p322300)
http://www.eileenslounge.com/viewtopic.php?p=322150#p322150 (http://www.eileenslounge.com/viewtopic.php?p=322150#p322150)
http://www.eileenslounge.com/viewtopic.php?p=322111#p322111 (http://www.eileenslounge.com/viewtopic.php?p=322111#p322111)
http://www.eileenslounge.com/viewtopic.php?p=322086#p322086 (http://www.eileenslounge.com/viewtopic.php?p=322086#p322086)
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA (https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA)
DocAElstein
02-28-2018, 12:22 AM
_1 ) Way 1) Use the CDO (Collaboration Data Objects ) object library available in VBA
Main Code , Sub PetrasDailyProWay1_COM_Way() ,
and
Function Code for solution to this Thread and Post
http://www.excelfox.com/forum/showthread.php/2233-Urgent-support-needed-Multiple-emails-multiple-Excel-workbooks-at-once
http://www.excelfox.com/forum/showthread.php/2233-Urgent-support-needed-Multiple-emails-multiple-Excel-workbooks-at-once?p=10518#post10518
Option Explicit ' Daily Diet plan, Sending of Notes and an Excel File
Sub PetrasDailyProWay1_COM_Way() ' Allow access to deep down cods wollops from Microsoft to collaborating in particular in the form of messaging. An available library of ddl library functions and associated things is available on request, the Microsoft CDO for Windows 2000. We require some of these ' CDO is an object library that exposes the interfaces of the Messaging Application Programming Interface (MAPI). API: interfaces that are fairly easy to use from a fairly higher level from within a higher level programming language. In other words this allows you to get at and use some of the stuff to do with the COM OLE Bollocks from within a programming language such as VBA API is often referring loosely to do with using certain shipped with Windows software in Folders often having the extension dll. This extension , or rather the dll stands for direct link libraries. These are special sort of executable files of functions shared by many other (Windows based usually) software’s.
' Rem1 The deep down fundamental stuff , which includes stuff been there the longest goes by the name of Component Object Model. Stuff which is often, but not always, later stuff, or at a slightly higher level of the computer workings, or slightly more to a specific application ( an actual running "runtime" usage / at an instance in time , "instance of" ) orientated goes to the name of Object Linking and Embedding. At this lower level, there are protocols for communicating between things, and things relate are grouped into the to Office application available Library, CDO. An important object there goes by the name of Message.
'Rem 1) Library made available ====================#
With CreateObject("CDO.Message") ' Folders mostly but not always are in some way referenced using dll, either as noted with the extension or maybe refered to as dll Files or dll API files.
'Rem 2 ' Intraction protocols are given requird infomation and then set
'2a) 'With --------------------* my Created LCDCW Library, (LCD 1.0 Library ) (Linking Configuration Data_Cods Wollups) which are used and items configured for the Exchange at Microsoft’s protocol thereof; http://schemas.microsoft.com/cdo/configuration/ ......This section provides the configuration information for the remote SMTP server
Dim LCD_CW As String: Let LCD_CW = "http://schemas.microsoft.com/cdo/configuration/" ' Linking Configuration Data : defines the majority of fields used to set configurations for various Linking Collaboration (LCD) Objects Cods Wollops: These configuration fields are set using an implementation of the IConfiguration.Fields collection. https://msdn.microsoft.com/en-us/library/ms872853(v=exchg.65).aspx
.Configuration(LCD_CW & "smtpusessl") = True ' ' ' HTTPS (Hyper Text Transfer Protocol Secure) appears in the URL when a website is secured by an SSL certificate. The details of the certificate, including the issuing authority and the corporate name of the website owner, can be viewed by clicking on the lock symbol on the browser bar. in short, it's the standard technology for keeping an internet connection secure and safeguarding any sensitive data that is being sent between two systems, preventing criminals from reading and modifying any information transferred, including potential personal details. ' SSL protocol has always been used to encrypt and secure transmitted data
.Configuration(LCD_CW & "smtpauthenticate") = 1 ' ... possibly this also needed .. When you also get the Authentication Required Error you can add this three lines.
' ' Sever info
.Configuration(LCD_CW & "smtpserver") = "smtp.gmail.com" ' "securesmtp.t-online.de" '"smtp.gmail.com" "smtp.mail.yahoo.com" "smtp.live.com" "pod51017.outlook.com" "smtp-mail.outlook.com" "smtp.live.com" "securesmtp.t-online.de" 465 SMTP is just used to mean the common stuff..... Simple Mail Transport Protocol (SMTP) server is used to send outgoing e-mails. The SMTP server receives emails from your Mail program and sends them over the Internet to their destination.
' The mechanism to use to send messages.
.Configuration(LCD_CW & "sendusing") = 2 ' Based on the LCD_OLE Data Base of type DBTYPE_I4
.Configuration(LCD_CW & "smtpserverport") = 25 ' 465or25fort-online ' 465 'or 587 'or 25 ' The port of type somehow refered to by the last line
'
.Configuration(LCD_CW & "sendusername") = "excelvbaexp@gmail.com" ' "Doc.AElstein@t-online.de" ' .... "server rejected your response". AFAIK : This will happen if you haven't setup an account in Outlook Express or Windows Mail .... Runtime error '-2147220975 (800440211)': The message could not be sent to the SMTP server. The transport error code is 0x80040217. The server response is not available
.Configuration(LCD_CW & "sendpassword") = "Bollocks" ' "Bollox"
' Optional - How long to try ( End remote SMTP server configuration section )
.Configuration(LCD_CW & "smtpconnectiontimeout") = 30 ' Or there Abouts ;) :)
' Intraction protocol is Set/ Updated
.Configuration.Fields.Update ' 'Not all infomation is given, some will have defaults. - possibly this might be needed initially .. .Configuration.Load -1 ' CDO Source Defaults
'End With ' -------------------* my Created LCDCW Library ( Linking Configuration Data Cods Wollups) which are used and items configured for the Exchange at Microsoft's protocol therof;
'2b) ' Data to be sent
'.To = "Doc.AElstein@t-online.de"
.To = "excelvbaexp@gmail.com"
.CC = ""
.BCC = ""
.from = """Alan"" <Doc.AElstein@t-online.de>"
.Subject = "Bollox"
'.TextBody = "Hi" & vbNewLine & vbNewLine & "Please find the Excel workbook attached."
.HTMLBody = MyLengthyStreaming
.AddAttachment "G:\ALERMK2014Marz2016\NeueBlancoAb27.01.2014\AbJan 2016\Übersicht aktuell.xlsx" ' ' Full File path and name. File must be closed
Rem 3 Do it
.Send
End With ' CreateObject("CDO.Message") (Rem 1 Library End =======#
End Sub
Public Function MyLengthyStreaming() As String
Rem 1 Make a long string from a Microsoft Word doc
'1(i) makes available the Library of stuff, objects, Methods etc.
Dim Fso As Object: Set Fso = CreateObject("Scripting.FileSystemObject")
'1(ii) makes the big File Object " Full path and file name of Word doc saved as .htm "
Dim FileObject As Object: Set FileObject = Fso.GetFile("G:\ALERMK2014Marz2016\NeueBlancoAb27.01.2014\AbJan 2016\ProMessage.htm"): Debug.Print FileObject
'1(iii) sets up the data "stream highway"
Dim Textreme As Object: Set Textreme = FileObject.OpenAsTextStream(iomode:=1, Format:=-2) ' reading only, Opens using system default https://msdn.microsoft.com/en-us/library/aa265341(v=vs.60).aspx
'1(iv) pulls in the data, in our case into a simple string variable
Let MyLengthyStreaming = Textreme.ReadAll ' Let MyLengthyStreaming = Replace(MyLengthyStreaming, "align=center x:publishsource=", "align=left x:publishsource=")
Textreme.Close
Set Textreme = Nothing
Set Fso = Nothing
Rem 2 possible additions to MyLengthyStreaming
Last bit of Function ( must go here in the excelfox Test Sub Forum in HTML Tags as there are HTML Tags in the final text string string and this makes a mess in normal BB code tags, because in excelfox Test Forum HTML is activated ) :
Rem 2
Let MyLengthyStreaming = "<p><span style=""color: #ff00ff;"">Start=========== " & Format(Now(), "DD MMMM YYYY") & " " & Now() & " ------------------------------------</span></p>" & MyLengthyStreaming & "<p><span style=""color: #ff00ff;"">-- " & Format(Now(), "DD MMMM YYYY") & " " & Now() & " ==End, Sent from Doc.AElstein Mail ======</span></p>"
End Function
DocAElstein
10-23-2024, 01:50 PM
This is post #7
https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks?p=24876&viewfull=1#post24876
https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues?p=24876&viewfull=1#pst24876
This is post #552
https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues/page56#post24323
https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues/page56#post24323
https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues?p=24317&viewfull=1#post24323
https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues?p=24317&viewfull=1#post24323
Edit: I gave up with this post after getting so many quirky results in Windows 10 and windows 11, so I started this Thread (https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks)
Some functions and rough notes on Versions on some computers used in the testings from this page 56 (https://bit.ly/40fepOB) and page 55 (https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues/Page55#post24120) and a few other related forum postings
Its useful to keep track of some of your computer specs, and Office versions when playing around with the codings on this page.
The macro below, Sub WhatAmI() ( along with the functions under it which go with it) may help to get some of that info. Run it and some info should appear in the Immediate Window. (From the VB Editor, hold the Ctrl key down and then hit key g to get that Immediate Window up)
Note there are a few bugs and quirks :
_ Application.OperatingSystem can give quirky answers in windows 11 (https://eileenslounge.com/viewtopic.php?p=313844#p313844) , so the operating system result may be wrong for if you have Windows 11. In fact currently it seems a bit wonky everywhere
_I don’t know if that macro gets it correct in Office versions 2016, 2019,2021, 2024 or 365, since I don’t have them versions to check. My guess is that it might be a bit iffy for 2016 2019,2024 or 365
Sub WhatAmI() ' https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues?p=24323&viewfull=1#post24323 https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues/page56#post24323
Debug.Print ExcelVersion & " " & Application.OperatingSystem & " (ApplicationVersion " & CLng(Val(Application.Version)) & ") Computer named " & CreateObject("WScript.Network").ComputerName ' Environ$("computername") Nigel Heffernan https://stackoverflow.com/questions/3551055/how-to-get-name-of-the-computer-in-vba/10108951#10108951
' Windows 11 (2021) ...
' Windows 10 S (2017) ...
' Windows 10 (2015) - MS Version 6.4. ...
' Windows 8/8.1 (2012-2013) - MS Version 6.2/6.3. ...
' Windows 7 (2009) - MS Version 6.1. ...
' Windows Vista (2006) - MS Version 6.0. ...
' Windows XP (2001) - MS Version 5.1. ...
' Windows 2000 (2000) - MS Version 5.0.
End Sub
Private Function ExcelVersion() As String ' From Rory somewhere, then a blind mod for above 2016 from https://excelguru.ca/check-the-application-version-in-modern-office/ , which probably does not work too well - https://excelguru.ca/check-the-application-version-in-modern-office/#comment-358558
Dim Temp As String
'On Error Resume Next
#If Mac Then
Select Case CLng(Val(Application.Version))
Case 11: Temp = "Excel 2004"
Case 12: Temp = "Excel 2008" ' this should NEVER happen!
Case 14: Temp = "Excel 2011"
Case 15: Temp = "Excel 2016 (Mac)"
Case Else: Temp = "Unknown"
End Select
#Else
Select Case CLng(Val(Application.Version))
Case 9: Temp = "Excel 2000"
Case 10: Temp = "Excel 2002"
Case 11: Temp = "Excel 2003"
Case 12: Temp = "Excel 2007"
Case 14: Temp = "Excel 2010"
Case 15: Temp = "Excel 2013"
Case 16: ' https://excelguru.ca/check-the-application-version-in-modern-office/
Let Temp = ForVersion16() '
Case Else: Temp = "Unknown"
End Select
#End If
#If Win64 Then
Let Temp = Temp & " 64 bit"
#Else
Let Temp = Temp & " 32 bit"
#End If
Let ExcelVersion = Temp
End Function
Function ForVersion16() As String ' https://excelguru.ca/check-the-application-version-in-modern-office/ This may be crap - https://excelguru.ca/check-the-application-version-in-modern-office/#comment-358558
'Test the Office application version, 'Written by Ken Puls (www.excelguru.ca) ' ...."From Office 2016 onwards, Microsoft has not revved the Application.Version number - they all show as 16.0 - giving you no way to differentiate between versions."....
Dim registryObject As Object
Dim rootDirectory As String, keyPath As String
Dim arrEntryNames As Variant, arrValueTypes As Variant
Dim x As Long
'Check for existence of Licensing key
Let keyPath = "Software\Microsoft\Office\" & CStr(Application.Version) & "\Common\Licensing\LicensingNext"
Let rootDirectory = "."
Set registryObject = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & rootDirectory & "\root\default:StdRegProv")
registryObject.EnumValues &H80000001, keyPath, arrEntryNames, arrValueTypes
On Error GoTo ErrorExit
For x = 0 To UBound(arrEntryNames)
If InStr(arrEntryNames(x), "365") > 0 Then
Let ForVersion16 = 365
Exit Function
End If
If InStr(arrEntryNames(x), "2019") > 0 Then
Let ForVersion16 = 2019
Exit Function
End If
If InStr(arrEntryNames(x), "2021") > 0 Then
Let ForVersion16 = 2021
Exit Function
If InStr(arrEntryNames(x), "2024") > 0 Then
Let ForVersion16 = 2024
Exit Function
End If
Next x
Exit Function
ErrorExit:
'Version 16, but no licensing key. Must be Office 2016
Let ForVersion16 = 2016
End Function
'Some typical results of my computers for future reference for me because I keep forgetting which versions I have where
' ExcelVersion Application.OperatingSystem (CLng(Val(Application.Version) CreateObject("WScript.Network").ComputerName ' Environ$("computername") Nigel Heffernan https://stackoverflow.com/questions/3551055/how-to-get-name-of-the-computer-in-vba/10108951#10108951
'(based on App.version)
' Excel 2007 32 bit Windows (32-bit) NT 6.00 (ApplicationVersion 12) Alan's Computer named ELSTON-LAPTOP KB Vista Office 2007
' Excel 2010 32 bit Windows (32-bit) NT 6.00 (ApplicationVersion 14) Computer named ELSTON-PC Alan's Computer GB Vista Office 10
' Excel 2003 32 bit Windows (32-bit) NT 6.01 (ApplicationVersion 11) Computer named ALAN-PC Martin Windows 7 Pro Office 2003
' Excel 2010 32 bit Windows (32-bit) NT 6.01 (ApplicationVersion 14) Computer named ALAN-PC Martin Windows 7 pro Office 2010
' Excel 2010 32 bit Windows (32-bit) NT 6.02 (ApplicationVersion 14) Computer named TM5730G Alan's Computer Verranda Windows 10 Office 10
' Excel 2013 32 bit Windows (32-bit) NT :.00 (ApplicationVersion 15) Computer named DESKTOP-G7BIH1B Alan's Computer SerSzuD2 Windows 10 Office 13
' Excel 2016 (Windows) 32 bit Windows (32-bit) NT 10.00 (ApplicationVersion 16) Alan's Computer named DESKTOP-14C4HCR Torrox Windows 10 Office 2016
' Excel 2010 32 bit Windows (32-bit) NT 6.02 (ApplicationVersion 14) Computer named ASPIRE7730G Elfy Windows 11 Office 10
'
DocAElstein
03-29-2025, 02:29 PM
Later
DocAElstein
03-29-2025, 02:30 PM
even later
DocAElstein
03-29-2025, 02:32 PM
This is post 11
https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25005&viewfull=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/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-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 (https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH/page2) , from post #14 (https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25008&viewfull=1#post25008)
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/threads/vba-autofilter-specialcells-xlcelltypevisible-copy-only-values-not-formulas.828241/#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.php?p=246740#p246740 3 Reset Clear Clipboard
Feb 2019 https://eileenslounge.com/viewtopic.php?p=246740#p246740 3 My good links Reset Clear Clipboard
https://eileenslounge.com/viewtopic.php?p=246884#p246884 2
https://eileenslounge.com/viewtopic.php?p=246838#p246838 2
https://eileenslounge.com/viewtopic.php?p=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/25091571/strange-behavior-from-vba-dataobject-gettext-returns-what-is-currently-on-the-c/54960767#54960767 2
Mar 2019 https://eileenslounge.com/viewtopic.php?p=247809#p247809 3 (Clipboard API alternative) array overflow date value Yasser rory
Mar 2019 My last post is best, https://eileenslounge.com/viewtopic.php?p=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.php?p=249755#p249755 4 multiple Clipboard for multiple cells MISTAKE WRONG Yasser was right
https://eileenslounge.com/viewtopic.php?p=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.php?p=279659#p279659 1 split clipboard
Jun 2021 https://www.eileenslounge.com/viewtopic.php?p=295816#p295816 1
https://www.eileenslounge.com/viewtopic.php?f=30&t=35100&p=295780#p295780 2 put Text file in Excel Clipboard wonder
Apr 2022 https://www.eileenslounge.com/viewtopic.php?p=294721#p294721 2 Clipboard Convert vertical to horizontal on multiple columns 26 Apr 2022 lost appendix
Jun 2022 https://www.eileenslounge.com/viewtopic.php?p=296145#p296145 2 Power shell not working speakeasy Clipboard first 100 lines text file PowerShell Clipboard
June 2022 https://www.eileenslounge.com/viewtopic.php?p=296126#p296126 3 PowerShell text set clipboard SpeakEasy works not me (snb CreateObject scripting.filesystemobject .opentextfile .readall )
DocAElstein
03-29-2025, 02:37 PM
Notes mostly originating from a bomb shell dropped by Mike, (SpeakEasy). The Windows Clipboard (https://www.eileenslounge.com/viewtopic.php?p=300947#p300947)
_ - - - - - - -
Nov 2022 https://www.eileenslounge.com/viewtopic.php?f=27&t=38910&p=301028#p301028 3 Office Windows Clipboard
Nov 2022 https://www.eileenslounge.com/viewtopic.php?p=300947#p300947 1 Mike we only have 1 windows clipboard …… just the Windows clipboard. The Office clipboard is just a specific view ….. the clipboard is owned at any particular point in time by the window (or task) that last placed data in the clipboard. In conjunction with this, an application can request that data it is putting on the clipboard use something called 'deferred render' mode - this means that the data is not actually put on the clipboard at that time, the intended purpose being related to performance - it is only provided when a request to paste the data is made. Data marked for deferred render is removed from the clipboard when the owning window is closed. Excel seems to mark quite a lot of data for deferred rendering .
For a range Excel puts about 30 different formats of the data on the clipboard in the following order https://i.postimg.cc/yJn7hGWq/excelclipboarformats.jpg (https://postimg.cc/yJn7hGWq) 5816 https://i.postimg.cc/Kkzx05g1/excelclipboarformats.png (https://postimg.cc/Kkzx05g1) The 'Office clipboard' and 'Excel clipboard' are just limited viewers of the Windows clipboard. As indicated above, the source application has the responsibility of putting all the formats it deems necessary onto the clipboard. The consuming app iterates that list of formats to see which ones it supports.
so what’s this then (https://www.eileenslounge.com/viewtopic.php?p=300955#p300955) https://www.eileenslounge.com/viewtopic.php?p=300955#p300955 4
so any application can monitor (and display to the best of their ability) the contents of the clipboard*. (* this, by the way, is why you can find a plethora of applets that purport to show the contents of the clipboard such as FreeClipView and ClipDiary (back in the day - XP - Microsoft had their own proper clipboard viewer, but they got rid of it; I suspect because it used the slightly unstable clipboard viewer chain mentioned above; the replacement in Windows 10, which only works if you turn on clipboard history - yes they added a history capability to the OS - lacks features ...)) …. This used to be by inserting a clipboard viewer into the clipboard viewer chain - but this is not as robust as it might be, and is the source of some of the 'bugs' that you refer to (e,g. if applications fail to maintain the clipboard viewer chain properly or if a window in the clipboard viewer chain stops responding to messages). The current best practice method is to create a Clipboard Format Listener, which then receives notifications every time the clipboard changes. Applications are free to display the current contents of the clipboard that they understand in order to show the user what is available to paste. And that's what the Office clipboard is: simply a bespoke view of the Windows clipboard, not an actual separate clipboard. There IS a minor wrinkle to this - the Office clipboard viewer maintains a history of clipboard entries (the clipboard itself can only ever hold one entry). Again without going into the nitty gritty, this history consists of data formats that the Office applications know how to render. This can cause some minor inconsistencies..
something somewhere is telling the clipboard - Indeed. Specifically, the WM_RENDERFORMAT message (https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues?p=18366&viewfull=1#post18366) - Sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function.
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
(Oh, and one other thing: .PutInClipboard can perform ... unexpectedly ... on occasion if Windows file explorer is open.)
https://www.eileenslounge.com/viewtopic.php?p=301028#p301028 14
Nov 2022 https://www.eileenslounge.com/viewtopic.php?p=301028#p301028 6 the windows clipboard ….. there is no such thing as an Excel Clipboard, and not even anything that might be considered as similar. _____ This thing, Let Application.CutCopyMode = False , is often said to clear the Excel Clipboard.
How about: It takes it out of the (Windows) Clipboard. So if you do a .Paste nothing will happen, as the (Windows) Clipboard is now empty, and the stupid thing is not as clever as that “Office thing that is similar to a clipboard” (that thing what we might call, for want of a better name, the Office Clipboard) , so it wont remember what was copied before. I note that Let Application.CutCopyMode = False makes the clipboard symbol go from orange to white. So maybe that is an indication of if the (Windows) Clipboard is occupied or not._.____________________________
That “Office thing that is similar to a clipboard” (that thing what we might call, for want of a better name, the Office Clipboard) , seems to hold a copied range including the format, long after other things have been copied , even if Let Application.CutCopyMode = False was used a few times, and even if the workbook from which it was copied has long since been closed. In fact, close Excel, go into Word, take a peek into the Office thing that is similar to a clipboard” (that thing what we might call, for want of a better name, the Office Clipboard) there, and you can also pick that copied Excel range out, and paste that copied Excel range into word. But now things are getting a bit inconsistent and quirky: I am finding that sometimes it will give me the formats and sometimes not, - Oh dear, Microsoft got their clipboard viewer chain in a tangle I expect._.____________________
I have often regarded the .Paste as using the Windows Clipboard, whereas I regarded the Excel .PasteSpecial function as using the Excel Clipboard.
Maybe .Paste is using the (Windows) Clipboard whereas the Excel .PasteSpecial function is just some coding to help you choose which version of the copy in the (Windows) Clipboard that you use.
_ - - - - - - - -
CumOnAbox971.!*
I don't have a Telekom anscluss
EileensLongeClipboard@t-online.de
CumOnEileen.!*
26 6 1945
NS Storm Fuhrer - beruf großvaters
015780900790 +4915780900790
Passwort für E-Mail-Programme SendCum.!*
Eileen CumHappy
CumOnAbox971.!*
docs.microsoft.com instead of learn.microsoft.com in archive search, if ya know what's good for ya
DocAElstein
03-29-2025, 02:37 PM
Dec 2022 https://www.eileenslounge.com/viewtopic.php?p=301534#p301534 2 Clipboard Trim Eval Range
https://www.eileenslounge.com/viewtopic.php?p=301761#p301761 2 Hans knatsch
Feb 2023 https://www.eileenslounge.com/viewtopic.php?p=304976#p304976 2 Do While Clipboard Gather unique values in one row for each unique key
May 2023 https://www.eileenslounge.com/viewtopic.php?f=26&t=39715&p=307826#p307826 2 clipboard ramble
Jan 2023 https://www.eileenslounge.com/viewtopic.php?p=303007#p303007 2 Clipboard opps a vbCr & vbLf OopsAvbCr&vbLf.xls
Jan 2023 https://www.eileenslounge.com/viewtopic.php?p=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 (https://learn.microsoft.com/en-us/windows/win32/dataxchg/clipboard-formats), which always ends CR LF )
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 (https://learn.microsoft.com/en-us/windows/win32/dataxchg/clipboard-formats)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.php?p=314950#p314950 Mike GUID list CLSIDs skids SCIDs
https://eileenslounge.com/viewtopic.php?p=289020#p289020 2 GUIDS CLSIDs in the { } as in CreateObject("New:" & “{aksjjfhaskj}” & "") Oct 2021
https://eileenslounge.com/viewtopic.php?p=286708#p286708 3 CLSID .NET 3.5
https://eileenslounge.com/viewtopic.php?p=289020#p289020 2 clsid Oct 2021 Feb 2016
https://chandoo.org/forum/threads/clipboard-copy-vba-code-not-working-in-windows-10.37126/#post-223256
API alternative
2012 Looks like first report of it https://web.archive.org/web/20200806111619/https://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
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/library/office/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/20240421213649/https://learn.microsoft.com/en-us/office/vba/access/Concepts/Windows-API/send-information-to-the-clipboard
> http://msdn.microsoft.com/en-us/library/office/ff194373.aspx (How to: Retrieve Information from the Clipboard). – original archived
2013 https://web.archive.org/web/20130113075556/http://msdn.microsoft.com/en-us/library/office/ff194373.aspx The original gets redirected to one from 2022 , archived at a similar date https://web.archive.org/web/20221203234848/https://learn.microsoft.com/en-us/office/vba/access/Concepts/Windows-API/retrieve-information-from-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-copy-strings-to-clipboard-using-excel-vba.html# [I]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/tutorials/vba-copy-to-clipboard-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/20191220024152/https://docs.microsoft.com/en-us/office/vba/language/concepts/forms/what-is-the-difference-between-the-dataobject-and-the-clipboard difference between the DataObject and the Clipboard
2018 https://chandoo.org/forum/threads/clipboard-copy-vba-code-not-working-in-windows-10.37126/#post-223256 Masterbasdor API Post
Mar 2019 My last post is best, https://eileenslounge.com/viewtopic.php?p=247809#p247809 , giving further links
Rory’s Tools https://eileenslounge.com/viewtopic.php?p=246708#p246708
Some random links not looked at yet
I don't have a Telekom anscluss
EileensLongeClipboard@t-online.de
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.php?p=247809#p247809 3 (Clipboard API alternative) array overflow date value Yasser rory
Mar 2019 My last post is best, https://eileenslounge.com/viewtopic.php?p=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.php?p=246708#p246708
Hans wrong https://www.eileenslounge.com/viewtopic.php?f=30&t=31849&start=20#p246887
docs.microsoft.com instead of learn.microsoft.com
https://learn.microsoft.com/en-us/archive/msdn-technet-forums/48e8c30c-24ee-458e-a873-a4e6e13f5926
https://docs.microsoft.com/en-us/archive/msdn-technet-forums/48e8c30c-24ee-458e-a873-a4e6e13f5926
https://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
DocAElstein
03-29-2025, 02:38 PM
This is post #14
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/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25008&viewfull=1#post25008
https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH/page2#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.php?p=288963#p288963 and here, https://eileenslounge.com/viewtopic.php?p=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/20140610024217/http://excelmatters.com/2013/05/21/transposing-an-array-using-an-in-memory-listbox/
CreateObject("New:{8BD21D20-EC42-11CE-9E0D-00AA006002F3}")
MSForms.DataObject https://web.archive.org/web/20140610055224/http://excelmatters.com/2013/10/04/late-bound-msforms-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.php?p=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.php?p=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:
' 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.php?p=314941#p314941 )
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 (https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-Pasting-API-Cliipboard-issues-and-Rough-notes-on-Advanced-API-stuff?p=24127&viewfull=1#post24127), ( #15 here ) (https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25009&viewfull=1#post25009 ) 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 (https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues?p=24138&viewfull=1#post24138) , ( ) 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 [URL=https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues?p=24137&viewfull=1#post24137] Later (] #17 here [/url)
' 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
DocAElstein
03-29-2025, 09:21 PM
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.
'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
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-Clsids-Mike-Clsids-Prog-IDs.jpg
https://i.postimg.cc/FRxkK7Wd/Me-Clsids-Mike-Clsids-Prog-IDs.jpg (https://postimg.cc/VrdkGLcm)____ ( https://i.postimg.cc/fLFpJjHk/Me-Clsids-Mike-Clsids-Prog-IDs.jpg)
DocAElstein
03-29-2025, 09:25 PM
Later
Post #16 https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25010&viewfull=1#post25010
https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25010&viewfull=1#post25010
https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH/page2#post25010
https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH/page2#post25010
My object creating abortion
In the coding of mine, ( Public Sub ListCLSIDs_Me() or Sub ListCLSIDs() ) , I only got the list of the 36 characters in the squiggly bracket , { curly bracket quid/Clsid stuff } things. ( I did not know for sure how to get the name )
But I was interested in the name thing. So as I was not sure how to do it, I wrote , back then, that second program, Sub CLSIDsValueNames() to try and get that name somehow. It basically creates the object, or tries to, and if it is successful, it tries to get the TypeName( object ) of that object.
It works just on the selection you make in column A, the 36 characters in the squiggly bracket , { } things.
Back then, I did a few . but, I broke off from doing it for all the 6527 things, as after doing a few, some applications started appearing after a computer restart, and I had to tank them from the Task Manager.
But for the ones I did do so far, there is some similarity between what I get for my
____ = TypeName( the created object )
, and what Mike effectively gets from these 2 lineyMike’s
RegObject.getstringvalue &H80000000, "CLSID" & entryArray(ExRowCnt) & "\ProgId", "", KeyValue
Prog = KeyValue
Here, just as example, some of the first results
https://i.postimg.cc/2jGKt0dz/Mine-and-Mikes-initial-results.jpg
https://i.postimg.cc/htkym6n0/Mine-and-Mikes-initial-results.jpg
https://i.postimg.cc/ncwwFMwg/Mine-and-Mikes-initial-results.jpg
https://i.postimg.cc/tgFrNkCG/Mine-and-Mikes-initial-results.jpg
https://i.postimg.cc/76DKszfG/Mine-and-Mikes-initial-results.jpg
https://i.postimg.cc/76DKszfG/Mine-and-Mikes-initial-results.jpg (https://postimages.org/)
Check out also the worksheet named CLSIDsOldVista4810TZG in this file
CLSDsUndClassNames.xls - https://app.box.com/s/nkjwti5yym9j0v634hrxerz4x7n1o90w
Here again that abortion of a coding
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
DocAElstein
03-29-2025, 09:31 PM
Some initial quick comparison thoughts
(Comparison mainly for now)
Here again the two macros in their slightly rearranged and modified form to help compare
https://i.postimg.cc/rskdx3bT/Me-Clsids.jpg https://i.postimg.cc/VN20LdWd/Me-Clsids-Mike-Clsids-Prog-IDs.jpg https://i.postimg.cc/RC7J4C6Z/Mike-Clsids-Prog-IDs.jpg
https://i.postimg.cc/QBkdfNP3/Me-Clsids-Mike-Clsids-Prog-IDs.jpg (https://postimg.cc/QBkdfNP3) 5814
https://i.postimg.cc/VN20LdWd/Me-Clsids-Mike-Clsids-Prog-IDs.jpg (https://postimg.cc/QBkdfNP3)
https://i.postimg.cc/FRxkK7Wd/Me-Clsids-Mike-Clsids-Prog-IDs.jpg (https://postimg.cc/VrdkGLcm)
The registry object looks the same. Its Getted as an object like these
Mike _ "winmgmts:{impersonationLevel=impersonate}!\" & strComputer & "\root\default:StdRegProv"
Me ___________________ "winmgmts:\\.\root\default:StdRegProv"
My code I cobbled together a bit wildly. I am not sure yet how Mike got his: (It can’t be the piss that is taken as English Beer, as that kills brain cells worse than old age)
We both do a .EnumKey thing referencing the CLSID which gives us an array back of a Variant types, (0 to 6525) . I use a variable KeyValues() , Mike uses a variable entryArray() . Those arrays are identical , perhaps as expected as the .EnumKey thing is very similar
___ .EnumKey &H80000000, "CLSID", entryArray() - Mike
.EnumKey 2147483650#, "SOFTWARE\Classes\CLSID", KeyValues() - Me
The array ( Me - KeyValues() , Mike entryArray() ) has exclusively strings in it, the first is just the word CLSID ,the rest of the 6525 are those 36 characters in the squiggly bracket , { } things.
We both effectively loop them strings out. I do just that. Mike makes that the first column that, ( and also Mike makes a second column, which appears to get the name you would use in the late binding thing CreateObject("name") thing. )
Squiggly bracket , { } thing
Regarding that thing in the Mike first of two columns, (the only thing my first macro does), so it is that 36 characters in the squiggly bracket , { } things. I ended up putting each squiggly bracket , { } thing in a variable KeyValue, getting each one out of my KeyValues() . Mike just loops out directly each of his entryArray() (He does in his original coding give that the heading, CLSID
The name you would use in the late binding thing CreateObject("name") thing.
My second abortion coding, Sub CLSIDsValueNames() (https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues?p=24137&viewfull=1#post24137) , attempted to get that. It did not work too well, but got something similar sometimes.
Mike gets that as well in his coding.
( Mike strangely uses the variable name KeyValue , for the name thing. Whereas I use the variable name KeyValue for the other thing, the squiggly bracket , { } things, which Mike uses no variable for but they comes from his entryArray() and he gives his first column the name CLSID . It is a bit pedantic perhaps, but I might like to think a bit more about the better more appropriate variable name as it can help understand/ remember what is going on **)
Mike gets the name effectively from a line each time inside the loop
.getstringvalue &H80000000, "CLSID" & entryArray(ExRowCnt) & "\ProgId", "", KeyValue
**Maybe one or both of us could do better with the name of our variables to make things more clear ??
Maybe later thoughts, …… later ….
For now I will post , at eileenslounge, and wait a while, in case someone Smarter has any comments.
https://eileenslounge.com/viewtopic.php?p=316704#p316704 (] here [/url)
https://eileenslounge.com/viewtopic.php?p=316705#p316705
( A few other for later, later thoughts ….._
_..... there is one obvious similarity in the two macros, they are using some WimMIe widget gismo thing. This WimMIe widget gismo stuff is a windows lurking thing so I expect you can get in a few ways. I feel a desire to do this sort of thing with PowerShell from within VBA. I’m not sure why yet , - either a simple perversion or some gut feeling that it might be handy later …. Not quite sure why yet … just a feeling in my bones that it could be useful )
Share ‘CLSDsUndClassNames.xls’ [url]https://app.box.com/s/nkjwti5yym9j0v634hrxerz4x7n1o90w This is from ca. 2021
DocAElstein
03-29-2025, 09:32 PM
This is post https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25011&viewfull=1#post25011
https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25011&viewfull=1#post25011
Another look at the abortion , 2024
I decided to risk it and went through all the squiggly bracket , { } things in the macro that tries to make an object from them like CreateObject("New:" & squiggly bracket { } thing & "")
It wasn’t so bad, - no new strange things appeared permanently
There were a few crashes which I either let Excel restart itself or I tanked the crashed Excel with the Task Manage r and restarted. ( It happened so much that I got the thing you get after a lot of crashes https://i.postimg.cc/t4w5CTYY/Wir-bedauern-die-Crashing.jpg )
A few other things I noticed.
There were a few hangs, not many
The OLE wait thing ( https://i.postimg.cc/Vkdg8Msx/OLE-waiting.jpg ) popped up few times. Hitting the OK usually moved it on. Occasionally once was enough but 3 times was most commonly required
Excel 2003 tried to install or configure a few times.
Some strange Xceed Encryption Library also appeared a few times https://i.postimg.cc/NGkp7BPz/Xceed-Encryption-Library.jpg
I was not quite so brilliant with VBA coding as I am now back when I wrote that first abortion coding, and also I thought it might be good to get some error messages. So I did another
Sub CLSIDsValueNames2() ' https://www.excelfox.com/forum/showthread.php/2824-Tests-Copying-pasting-Cliipboard-issues/page54#post24118
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 only in column A": Exit Sub
If Not RngSel.Cells.Column = 1 Then MsgBox prompt:="Please select at least 1 cell in column A": Exit Sub
Dim stearCel As Range
For Each stearCel In RngSel
Let Ws.Range("D" & stearCel.Row & "") = ""
Let Ws.Range("B" & stearCel.Row & "") = "Tried" ' To indicate I tried - this can be useful to see where it crashed
Dim OOPObj As Object
On Error GoTo Bed
Set OOPObj = CreateObject("New:" & stearCel.Value & "")
On Error GoTo 0
On Error GoTo Bed2
Let Ws.Range("D" & stearCel.Row & "") = Ws.Range("D" & stearCel.Row & "") & TypeName(OOPObj)
On Error GoTo 0
Skipper:
On Error Resume Next
OOPObj.Close
On Error GoTo 0
Set OOPObj = Nothing
Next stearCel
Exit Sub
Bed: ' Error on create object
Let Application.DisplayAlerts = False
ThisWorkbook.Save ' This is done to save all got so far in the case of an error
Let Application.DisplayAlerts = True
Let Ws.Range("D" & stearCel.Row & "") = "Error on creat object " & Err.Description & " " & Err.Number
Resume Next
Bed2: ' Error on TypeName
Let Ws.Range("D" & stearCel.Row & "") = Ws.Range("D" & stearCel.Row & "").Value & " Error on type name " & Err.Description & " " & Err.Number
On Error GoTo -1
On Error GoTo 0
GoTo Skipper
End Sub
Sub SpeakEasy()
Dim objIE As Object
Set objIE = GetObject("new:{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}")
MsgBox TypeName(objIE)
End Sub
Sub RegyRead()
Dim key As String, RegRead As String
Let key = "{1C3B4210-F441-11CE-B9EA-00AA006B1A69}"
Dim Ws As Object
Set Ws = CreateObject("WScript.Shell")
RegRead = Ws.RegRead(key)
Set Ws = Nothing
End Sub
It tells me the error if the object could not be made (if the CreateObject("New:" & squiggly bracket { } thing & "") line errors ) , ( as well if the object making seemed ok, but then the TypeName(object) errors - that situation occurs rarely)
( Also in column C, I added some extra notes about things that happened. I may be a cell or two out on when it happened, but if that is the case, I mention that I am not sure )
Here are the things that happened
https://i.postimg.cc/BQfvbmK9/OLE-waiting.jpg
https://i.postimg.cc/mgb2Nhjm/One-Note-help.jpg
https://i.postimg.cc/50Z2w3Kz/Other-version-of-runtime-is-already-loaded-v2-0-50727.jpg
https://i.postimg.cc/Kv78MtPK/Programmzuordnung-festlegen.jpg
https://i.postimg.cc/pdcTdxDq/Research-task-pane.jpg
https://i.postimg.cc/0Q6NM3nx/Speech-pop-up.jpg
https://i.postimg.cc/SQMsmBjf/Unable-to-connect-to-the-Synaptics-Pointing-device-Driver.jpg
https://i.postimg.cc/1Xw5Mqbj/Videoimport.jpg
https://i.postimg.cc/9QJXxVNC/Xceed-Encryption-Library.jpg
The version thing is inconsistent, not always happening , as are both some of the crashes , and some of the number of times an "OLE" pop up needs to be clicked on to move on . But I think I have a 90% good report of what would happen.
https://i.postimg.cc/wvhhP0yX/Results-Sub-CLSIDs-Value-Names2.jpg
https://i.postimg.cc/nhPYQsfD/Results-Sub-CLSIDs-Value-Names2.jpg
https://i.postimg.cc/76v3mp6P/Results-Sub-CLSIDs-Value-Names2.jpg
582258235824
https://i.postimg.cc/wvhhP0yX/Results-Sub-CLSIDs-Value-Names2.jpg (https://postimages.org/)
https://i.postimg.cc/nhPYQsfD/Results-Sub-CLSIDs-Value-Names2.jpg (https://postimages.org/)
https://i.postimg.cc/76v3mp6P/Results-Sub-CLSIDs-Value-Names2.jpg (https://postimg.cc/Ty95PNgB)
DocAElstein
03-30-2025, 03:27 PM
This is post, https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25013&viewfull=1#post25013
https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25013&viewfull=1#post25013
https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH/page2#post25013
https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH/page2#post25013
Pondering.....
Some more Clsid stuff and revision, March 2025
Originally I was just interested in some more info on the annoyances of different settings coupled with Excel guessing what you want to see when you type something in a cell, ( https://eileenslounge.com/viewtopic.php?p=325768#p325768 , https://eileenslounge.com/viewtopic.php?f=27&t=42065 ) , but we slipped back into registry Clsid ponderings after some codings were unlikely to work with default VBA registry settings.
This post for the time being is another review/ refresh on the actual coding , with emphasis on bringing the thing into a single registry object coding to look at stuff. Why? – well I thought someone aught to by now…. :)
Brief Review of the coding ideas, past/ previous
For a diverse number of reasons the codings of mine and Mike's have come about, and that is discussed to death in the posts above and other references therein.
Lets start again today, talking generally about the coding(s) as a whole, single like entity, sort of what's going on.
_ A "registry object" is made………. GetObject("winmgmts ……………..
_ That gets refined/ narrowed down a bit via a .EnumKey which has three arguments,
__the first narrows us down to (in our example the first) one of these 5 regedit explorer things ( https://i.postimg.cc/6pgdTX9M/The-5-Reg-explorer-bits.jpg )
' HKEY_CLASSES_ROOT (2147483648#) (&H80000000)
' HKEY_CURRENT_USER (2147483649#)
' HKEY_LOCAL_MACHINE (2147483650#)
' HKEY_USERS (2147483651#)
' HKEY_CURRENT_CONFIG (2147483653#)
__ the second is a further narrowing down via part of the "explorer path length" string to get you somewhere. (In our example Mike use "CLSID" ( and me some erroneous "SOFTWARE\Classes\CLSID", but I think they end up both here at Clsid(** or maybe not ), because there is good correlation finally with what the third argument gets filled with https://i.postimg.cc/fTj235yG/Good-correlation-CLSIDs.jpg
https://i.postimg.cc/fTj235yG/Good-correlation-CLSIDs.jpg (https://postimages.org/)
** First noticed in this review later in 2025.. We are both in fact not going to the same place. But I missed it as the lists look identical…… here we were going
HKEY_LOCAL_MACHINE - SOFTWARE\Classes\CLSID - ' Me
HKEY_CLASSES_ROOT - CLSID - ' Mike
__ the third argument is what you have to give, - a Variant is commonly used. A dynamic array seems to work as well, and it gets filled with those {Quid Clsid}s which seem to be just strings, (but you have to use a Variant type array declaration or the array comes back of the right size but something goes screwy and the elements are empty somehow erroneously)
_.___
At this point the codings differed a bit…
I did nothing else but print out (loop the ) the Clsid list. (Then later in a different coding I used it/ them in my attempt to do a
_ object = CreateObject("New:" & …… the {Clsid}
, followed by a
_ TypeName( … of the created object if it got one
Mike had a another use of the register object, an extra code line inside the loop to get the Clsid list, he had this which is not so different from the .EnumKey, this time its a .getstringvalue
, RegObject.getstringvalue &H80000000, "CLSID" & entryArray(ExRowCnt) & "\ProgId", "", KeyValue
, and we get just one thing back from the last argument this time, and that is a "ProgID" , if there is one, - some do have one, ( https://i.postimg.cc/QxY0cQH6/ProgID.jpg ) , ( and that code line don't error if there isn't one). The result often has similarities to the TypeName(object) that I get. (My way is more prone to errors and crashes, and other weird things)
So that is the Sunday summary / revision
Now a bit of a Sunday and Monday Late March 2025, Ponder
Ponder ponder ponder ....
still pondering, ....
DocAElstein
03-31-2025, 02:09 PM
From Mike (https://eileenslounge.com/viewtopic.php?p=326198#p326198) > that list is perhaps derived from a registry list ,
HKEY_CLASSES_ROOT\TypeLib
OK, Let's take a look….
There is a bit of an awkward thing with sub Folders with different numbers on. Here is the first few
https://i.postimg.cc/k4Jm9RQ6/Type-Lib-Microsoft-Active-X-Data-Objects-2-0-Library.jpg
https://i.postimg.cc/k4Jm9RQ6/Type-Lib-Microsoft-Active-X-Data-Objects-2-0-Library.jpg (https://postimages.org/) 6190
Probably those numbers are in the range 1.0 to 6.0 or there abouts. Never mind, I am sure my high levels of VBA skillture will get me over that little hurdle ….. here we go then …. Hold ya butts ….
[EDIT This coding is a pile or Wank ,
( You may want to revisit your code, as it seems to be dropping some names. (https://eileenslounge.com/viewtopic.php?p=326248&sid=e23c2da06b4f9317f940bf6c80ab1607#p326248) )
, hopefully these pages will do better
https://www.excelfox.com/forum/showthread.php/2997-Testies-external-shared-Libraries-regedit-registry/page2
https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH/page3
Public Sub ListQuid() ' https://eileenslounge.com/viewtopic.php?p=326180#p326180 ' 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, MeQuids() As Variant, QuidsNmbrValue As Variant
Set RegObject = GetObject("winmgmts:\\.\root\default:StdRegProv")
RegObject.EnumKey 2147483648#, "TypeLib", MeQuids() ' https://powershell.one/wmi/root/cimv2/stdregprov-EnumKey
Dim Cnt As Long, ExRowCnt As Long: Let ExRowCnt = 1 ' ==============================================
For Cnt = LBound(MeQuids()) To UBound(MeQuids())
Let Ws.Range("K" & ExRowCnt + 1 + 1 & "") = MeQuids(Cnt)
' RegObject.getstringvalue 2147483648#, "TypeLib\" & MeQuids(Cnt) & "\2.0", "", QuidsNmbrValue ' as example this is the first one, https://i.postimg.cc/k4Jm9RQ6/Type-Lib-Microsoft-Active-X-Data-Objects-2-0-Library.jpg
' This extra loop stuff could probably be done better ' ----------------------------------------
Dim strQuidNmbr As String, QuidNmbr As Single
For QuidNmbr = 1 To 6 Step 0.1
Let strQuidNmbr = Format(QuidNmbr, "0.0")
RegObject.getstringvalue 2147483648#, "TypeLib\" & MeQuids(Cnt) & "\" & strQuidNmbr & "", "", QuidsNmbrValue
If IsNull(QuidsNmbrValue) Then
Else
Let Ws.Range("L" & ExRowCnt + 1 + 1 & "") = QuidsNmbrValue
Let ExRowCnt = ExRowCnt + 1
End If
Next QuidNmbr ' ----------------------------------------------------------------------------
If Ws.Range("K" & ExRowCnt + 1 + 1 & "").Value <> "" Then Let ExRowCnt = ExRowCnt + 1 ' This will make sure we also go down a lins for any Quid with no name
Next Cnt ' ================================================== ===========================
End Sub
Sub SortIt() ' This will help to get a similar order to that seen in the VB Editor referrence list
Dim Ws As Worksheet: Set Ws = ThisWorkbook.Worksheets("CLSIDsOldVista4810TZG")
Ws.Range("M3:N666") = Ws.Range("K3:L666").Value
Ws.Range("M3:N666").Sort Key1:=Ws.Range("N3:N666"), Order1:=xlAscending
End Sub
' https://eileenslounge.com/viewtopic.php?p=326198#p326198 https://eileenslounge.com/viewtopic.php?p=326198&sid=6f3fd375f6153093b306e77e56d88af9#p326198
' HKEY_CLASSES_ROOT (2147483648#) (&H80000000)
' HKEY_CURRENT_USER (2147483649#)
' HKEY_LOCAL_MACHINE (2147483650#)
' HKEY_USERS (2147483651#)
' HKEY_CURRENT_CONFIG (2147483653#)EDIT This coding is a pile or Wank ,
( You may want to revisit your code, as it seems to be dropping some names. (https://eileenslounge.com/viewtopic.php?p=326248&sid=e23c2da06b4f9317f940bf6c80ab1607#p326248) )
, hopefully these pages will do better
https://www.excelfox.com/forum/showthread.php/2997-Testies-external-shared-Libraries-regedit-registry/page2
https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH/page3
Re arranged in alphabetical order in column N of uploaded file, and compared, - there is very close agreement:
https://i.postimg.cc/28kgC7XD/Good-Correlation-Quid-from-HKEY-CLASSES-ROOT-Type-Lib-to-referrencee.jpg https://i.postimg.cc/fkP8KmN2/Good-Correlation-Quid-from-HKEY-CLASSES-ROOT-Type-Lib-to-referrencee.jpg (https://postimg.cc/fkP8KmN2) 6192
https://i.postimg.cc/28kgC7XD/Good-Correlation-Quid-from-HKEY-CLASSES-ROOT-Type-Lib-to-referrencee.jpg (https://postimg.cc/fkP8KmN2)
DocAElstein
04-02-2025, 10:13 PM
This is posts https://www.excelfox.com/forum/showthread.php/2986/page3#post25028
https://www.excelfox.com/forum/showthread.php/2997/page2#post25032
Some extra notes to go with these main forum post
https://eileenslounge.com/viewtopic.php?p=326446#p326446
I am catching up here and responding to some of the interesting info in this post (https://eileenslounge.com/viewtopic.php?p=326247#p326247)
I might also be responding to the second half of this one (https://eileenslounge.com/viewtopic.php?p=326198#p326198) , bit I still have not quite figured out what was being said there. ( I wasn't confused by the AidFromGuid metjhopd , - I know that's the SiP syndrone (Smartphone In Pub) :smile: )
Or maybe I am just pondering, a not uncommon occurrence
So… Update so far, and introduction to current stand
Going back a year and / or 4, we have tangled with "Clsid registry lists" before, and the digressions here forced me to revise them again, from and around here (https://www.excelfox.com/forum/showthread.php/2986/?p=25008&viewfull=1#post25008), or there abouts.
I had back then a bad Winniemidgetgismo coding, and Mike did it better, (a not un common state of affairs in recent years….)
It ended up like this
https://i.postimg.cc/Y9Q7rPYQ/Old-Clsid-Lists.jpg
https://i.postimg.cc/ZBY2jVfq/Old-Clsid-Lists.jpg (https://postimg.cc/ZBY2jVfq)
The coding that got the lists…
What I tried was I Initially got just the Clsid list and then, a while later, I tried to stick them pseudo in a
Obj = CreateObject("New:" & MeClisid & "")
, see what happened. It did not damage or break too much on my computers, at last not all of them always, but I was not too sure what was going on. If an attempt did not error or break something, then I did a
TypeName(Obj)
, on the resulting object. I am not sure why I did that, I expect I just thought at the time that somebody perhaps should. I had no idea what the results were telling me.
You ( You= Mike (https://eileenslounge.com/memberlist.php?mode=viewprofile&u=8741) ) in your coding equivalent got both the Clsid list and a ProgID. (And as I understand a bit better the winygismo codings I know now where that came from). Your code never errored or broke things like mine did, and there were sometimes similarities with your ProgID results and my TypeName(Obj), for the same Clisid
https://www.excelfox.com/forum/showthread.php/2986/?p=25010&viewfull=1#post25010
https://www.excelfox.com/forum/showthread.php/2986/?p=25012&viewfull=1#post25012
CLSDsUndClassNames.xls - https://app.box.com/s/nkjwti5yym9j0v634hrxerz4x7n1o90w
But I was still none the wiser on what it all meant..
But I am getting there now…
So lets look at your current example (https://eileenslounge.com/viewtopic.php?p=326247#p326247): https://i.postimg.cc/NMvg1Dw0/Little-referrence-checking-window-Microsoft-Scripting-Runtime.jpg https://i.postimg.cc/7hD0QSSH/Microsoft-Scripting-Runtime-more-explicitly-human-readable-name-that-appears-when-you-are-adding-a.jpg This is whre we might fist come across it, when "checking a reference for Early Binding"
https://i.postimg.cc/FfG5vjzt/Little-referrence-checking-window-Microsoft-Scripting-Runtime.jpg (https://postimg.cc/FfG5vjzt) We have learnt now that the relevant word to use there is the "human readable description" or "TypeLib human readable name", aka the name to look for in the little window for checking a reference
, - and here it is in "the Clsids" file of mine from s few years back
https://i.postimg.cc/05f8w7X8/Clsid-Microsoft-Scripting-Runtime.jpg ,
{0D43FE01-F093-11CF-8940-00A0C9054228} Tried FileSystemObject {0D43FE01-F093-11CF-8940-00A0C9054228} Scripting.FileSystemObject
https://i.postimg.cc/4m7LvBkX/Microsoft-Scripting-Runtime-in-old-File.jpg (https://postimg.cc/4m7LvBkX)
Here we can see it again in the little reference checking VB Editor window, https://i.postimg.cc/NMvg1Dw0/Little-referrence-checking-window-Microsoft-Scripting-Runtime.jpg https://i.postimg.cc/JD6ssDTv/Microsoft-Scripting-Runtime-more-explicitly-human-readable-name-that-appears-when-you-are-adding-a.jpg (https://postimg.cc/JD6ssDTv) , but that is perhaps not coming from directly from there, well maybe it is sort of,….
This is something new we picked up, Here it is (a different Guid number note), in the Registry Hive HKEY_CLASSES_ROOT , at the path TypeLib\{420B2830-E718-11CF-893D-00A0C9054228}\1.0
https://i.postimg.cc/J01MFh0V/Reg-Type-Lib-Microsoft-Scripting-Runtime.jpg
https://i.postimg.cc/YGy5GMQb/Reg-Type-Lib-Microsoft-Scripting-Runtime.jpg (https://postimg.cc/YGy5GMQb)
And we got some more recent Winnie codings to get that TypeLib info
{420B2830-E718-11CF-893D-00A0C9054228} 1.0 Microsoft Scripting Runtime
So that is a refresh on the Clsid stuff, and a bit extra about the TypeLib Guid
( This is also the Guid used in the .AddFroGuid – We do mot use the Clsid Guid there! )
Now we will move on in the next post
DocAElstein
04-06-2025, 09:31 PM
This is posts https://www.excelfox.com/forum/showthread.php/2997-Testies-external-shared-Libraries-regedit-registry?p=25033&viewfull=1#post25033
https://www.excelfox.com/forum/showthread.php/2997/?p=25033&viewfull=1#post25033
https://www.excelfox.com/forum/showthread.php/2997/page2#post25033
https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25034&viewfull=1#post25034
https://www.excelfox.com/forum/showthread.php/2986/?p=25034&viewfull=1#post25034
https://www.excelfox.com/forum/showthread.php/2986/page3#post25034
I am slightly upset at this point that the two different Guids in the last post
_ { the Clsid Guid }
and
_ { the other Guid ( related to "human readable description" or "TypeLib human readable name" given in that little window which you use to check a external library reference from the VB Editor , and the one to use in the .AddFromGuid ) }
are not more similar. Here they are again,
{0D43FE01-F093-11CF-8940-00A0C9054228} ' Clsid Guid FileSystemObject Scripting.FileSystemObject
{420B2830-E718-11CF-893D-00A0C9054228} ' TypeLib Guid 1.0 Microsoft Scripting Runtime
( But they are a bit similar. Maybe part of them would always be the same?? )
However, all is not lost., or maybe not always. Take a look at the other info that is sometimes there for a Clsid:
https://i.postimg.cc/HW543w1J/Microsoft-Scripting-Runtime-Inproc-Server32.jpg
https://i.postimg.cc/90GdMhYP/Microsoft-Scripting-Runtime-Prog-ID.jpg
https://i.postimg.cc/XqMK4Jd7/Microsoft-Scripting-Runtime-Type-Lib.jpg
https://i.postimg.cc/Bv6BCRJs/Microsoft-Scripting-Runtime-Version.jpg
https://i.postimg.cc/n9X9PwhW/Microsoft-Scripting-Runtime-Inproc-Server32.jpg (https://postimg.cc/n9X9PwhW)https://i.postimg.cc/rzs4szN9/Microsoft-Scripting-Runtime-Prog-ID.jpg (https://postimg.cc/rzs4szN9)https://i.postimg.cc/R3Tt6HYg/Microsoft-Scripting-Runtime-Version.jpg (https://postimg.cc/R3Tt6HYg)https://i.postimg.cc/tZSVDHpP/Microsoft-Scripting-Runtime-Type-Lib.jpg (https://postimg.cc/tZSVDHpP)
6206620762086209
In particular this: https://i.postimg.cc/nc3B0jrx/Microsoft-Scripting-Runtime-Clsid-telling-me-Type-Lib.jpg
https://i.postimg.cc/nc3B0jrx/Microsoft-Scripting-Runtime-Clsid-telling-me-Type-Lib.jpg (https://postimages.org/)
So we can see that the info to the TypeLib ( related to "human readable description" or "TypeLib human readable name" given in that little window which you use to check a external library reference from the VB Editor, which is also the one to use in the .AddFromGuid ) is also there.
What next, getting a bit confused with different Guids and different registry issues.
I think at this stage, I want to extend the investigation into the Guids on the XP machine that I recently I did the extensive Guid lists on ( https://eileenslounge.com/viewtopic.php?p=326377#p326377
https://eileenslounge.com/viewtopic.php?p=326431#p326431 ) , just to check out the full Clsid/ Guid situation before and perhaps after the TLBINF.dll registration (https://eileenslounge.com/viewtopic.php?p=326155#p326155)
DocAElstein
04-09-2025, 09:14 PM
Clsid and other Guid lists review
We have
_ (i) some newer "TypeLib"codings, ( including a API one!! from Mike (https://eileenslounge.com/viewtopic.php?p=326275#p326275)) which look at the Guid ( "TypeLib Guid" )related to "human readable description" or "TypeLib human readable name" given in that little window which you use to check a external library reference from the VB Editor which is also the one to use in the .AddFromGuid . The full list of these Guids is at the registry path Computer HKEY_CLASSES_ROOT TypeLib
and
_(ii) an older "Clsid Guid" getting set of codings from me and Mike, reviewed again recently from about here: https://www.excelfox.com/forum/showthread.php/2986-Version-Info-using-VBA-and-registry-quirks-InterRegional-Settings-GmbH?p=25008&viewfull=1#post25008
In this post I would like to update again the latter earlier Clsid Guid codings, or rather make a new single one, to include, or at least investigate, the possibility of getting the TypeLib Guid as well from it, and some other information, following the discussions of the last posts, which showed that sometimes we may have that TypeLib Guid and/ or other information "at the Clisid" list, as it were.
This post discusses the coding. The over next posts discusses the results
Rem 1 The first thing it does is get the full Clsid list at the registry Computer\HKEY_CLASSES_ROOT\CLSID using the Winnie way.
There are 4972 Clsids for the XP Notebook that I have recently been using in these recent discussions ( My name for that notebook is Keks, or KeksXP or similar ). (The returned array has 4973 elements, the first one, indicia 0, has a text in it CLSID )
This code next line puts the full CLSID list from here , https://i.postimg.cc/Tw8Th8bH/Computer-HKEY-CLASSES-ROOT-CLSID.jpg , https://i.postimg.cc/L4DhQXL9/HKEY-CLASSES-ROOT-CLSID.jpg , into the Array Clsids(),
RegInfoPro.EnumKey RegHive, "CLSID", Clsids()
In each of the , ====== main loopings, each Clsid is listed in one column, and then that same Clsid is further used to get other column outputs, (if they are available, "at the Clsid") :
https://i.postimg.cc/k2ghHnYw/Other-Info-at-Clsid.jpg (https://postimg.cc/k2ghHnYw)https://i.postimg.cc/NLwtzH64/Other-Info-at-Clsid.jpg (https://postimg.cc/NLwtzH64)
Rem 3 InprocServer32 ' This seems to be the .dll or similar file
Rem 4 ProgID - see Mike here https://eileenslounge.com/viewtopic.php?p=326247#p326247 - ProgID is [Library].[Object]
Rem 5 Version number held "at the Clsid"
Rem 6 TypeLib Guid if there is one held "at the Clsid"
Rem 7 Try to make an object type with Obj = CreateObject("New:" & { The Clsid } & "") , then, if successful try to do a TypeName(LateBndObj) on that object
( In the previous codings from a year or 4 ago, we did just the
ProgID from Mike
, and the
Try to make an object type with Obj = CreateObject("New:" & { The Clsid } & "") , then, if successful try to do a TypeName(LateBndObj) on that object from me
The results were similar. )
So far the coding discussed is a slightly more detailed info getting version of the previous Clsid codings.
But there is one further important new part of this coding:
'6b - we investigate the specific TypeLib Guid , (if there was one at the Clsid) , at the place where the full TypeLib Guid list is. We expect that the TypeLib Guid will mostly be there but we investigate if there are other more than one version, as well as comparing the actual version numbers there with that of Rem 5 Version number held "at the Clsid"
DocAElstein
04-10-2025, 01:36 AM
Coding discussed in last post.
Results and conclusions in next posts
Option Explicit
Sub BonnieBonnieBoundsOfCLSIDs() ' https://www.excelfox.com/forum/showthread.php/2997-Testies-external-shared-Libraries-regedit-registry?p=25037&viewfull=1#post25037 ' KeksXP()
Rem 0
On Error GoTo OtherError
Dim Ws As Worksheet: Set Ws = Me
Let Ws.Range("A1:I1") = Array("", "TypeName(Obj)", "ProgID", "Clsid", "Version at Clsid", "TypeLib Guid", "Version at TypeLib", "Human readable name", "File")
'Me.Columns("A:I").Clear
Dim StrCom As String: Let StrCom = "."
Dim RegInfoPro As Object: Set RegInfoPro = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & StrCom & "\root\default:StdRegProv")
Dim RegHive As Long: Let RegHive = -214748364.8 * 10
Rem 1 Clsids - for Clsid output, (but also to use for the other outputs)
Dim Clsids() As Variant
RegInfoPro.EnumKey RegHive, "CLSID", Clsids() ' Computer\HKEY_CLASSES_ROOT , CLSID , here comes the big array of all ya Clsids
Dim ClsInfCnt As Long, Rw As Long: Let Rw = 1 ' This keeps track of the rows - there will likely be more than there are Clsids as we need an extra row for versions at the TypeLib place
For ClsInfCnt = LBound(Clsids()) To UBound(Clsids()) ' The main Clsid Loop =======================
Let Rw = Rw + 1 ' Every Clsid is on a new line
Let Ws.Range("A" & Rw & "") = ClsInfCnt & " " & Rw ' The first is a 0 and in the array is "CSID" after that in the array you get the { Guid thingy } format https://i.postimg.cc/mrHxggQD/Computer-HKEY-CLASSES-ROOT-CLSID.jpg
Let Ws.Range("D" & Rw & "") = Clsids(ClsInfCnt) ' The main { Clsid thingy }
Rem 3 InprocServer32 ' This seems to be the .dll or similar file
Dim IprcSvr32 As Variant
RegInfoPro.getstringvalue RegHive, "CLSID\" & Clsids(ClsInfCnt) & "\InprocServer32", "", IprcSvr32
If IsNull(IprcSvr32) Then
Let Ws.Range("I" & Rw & "") = " -"
Else
Let Ws.Range("I" & Rw & "") = IprcSvr32
End If
Rem 4 ProgID (- see Mike here https://eileenslounge.com/viewtopic.php?p=326247#p326247 ) if there is one held "at the Clsid"
Dim PrgID As Variant
RegInfoPro.getstringvalue RegHive, "CLSID\" & Clsids(ClsInfCnt) & "\ProgID", "", PrgID
If IsNull(IprcSvr32) Then
Let Ws.Range("C" & Rw & "") = " -"
Else
Let Ws.Range("C" & Rw & "") = PrgID
End If
Rem 5 Version numnber if there is one held "at the Clsid"
Dim CGVers As Variant
RegInfoPro.getstringvalue RegHive, "CLSID\" & Clsids(ClsInfCnt) & "\Version", "", CGVers
If IsNull(CGVers) Then
Let Ws.Range("E" & Rw & "") = " -"
Else
Let Ws.Range("E" & Rw & "") = "'" & CGVers
End If
Rem 6 TypeLib Guid if there is one held "at the Clsid"
Dim TypeLibGuid As Variant
RegInfoPro.getstringvalue RegHive, "CLSID\" & Clsids(ClsInfCnt) & "\TypeLib", "", TypeLibGuid
If IsNull(TypeLibGuid) Then
Let Ws.Range("F" & Rw & "") = " -"
Else ' Time to get the array of versions
Let Ws.Range("F" & Rw & "") = TypeLibGuid ' The Guid related to "human readable description" or "TypeLib human readable name" given in that little window which you use to check a external Library reference from the VB Editor , and the one to use in the .AddFromGuid
Dim Vers As Variant, CntV As Long ' Vers can be ab array or Null
'6b)
RegInfoPro.EnumKey RegHive, "TypeLib\" & TypeLibGuid, Vers
If IsNull(Vers) Then
Let Ws.Range("G" & Rw & "") = "Null versions at Computer\HKEY_CLASSES_ROOT\TypeLib"
Else
For CntV = LBound(Vers) To UBound(Vers)
Let Ws.Range("G" & Rw & "") = "'" & Vers(CntV)
Dim Description As String ' Might think about having this Variant. This is the "human readable description" or "TypeLib human readable name" given in that little window which you use to check a external Library reference from the VB Editor , and the one to use in the .AddFromGuid
RegInfoPro.getstringvalue RegHive, "TypeLib\" & TypeLibGuid & "\" & Vers(CntV), "", Description
Let Ws.Range("H" & Rw & "") = Description
If CntV < UBound(Vers) Then Let Rw = Rw + 1 ' we need an extra line for the next version
Next CntV
End If
End If
Rem 7 Try to make an object type ' Do this last as it can crash and/ or set the Devil loose
Dim LateBndObj As Object
On Error GoTo BadObjType ' I expect the next line often to error when I try to use
Set LateBndObj = CreateObject("New:" & Clsids(ClsInfCnt) & "")
On Error GoTo OtherError
Let Ws.Range("B" & Rw & "") = TypeName(LateBndObj)
BonniBanksOfLochLomond: '
Next ClsInfCnt ' The main Clsid loop ================================================== ===========
Exit Sub
BadObjType:
Let Ws.Range("B" & Rw & "") = "Err '" & Err.Number & "': " & Err.Description
Let Ws.Range("B" & Rw & "").Font.Color = 12632256
On Error GoTo -1
On Error GoTo OtherError
GoTo BonniBanksOfLochLomond ' https://eileenslounge.com/viewtopic.php?p=326446#p326446
OtherError:
Stop
Debug.Print "Err '" & Err.Number & "': " & Err.Description & " " & ClsInfCnt & " " & Rw
Stop
Resume Next
End Sub
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.