Reference... AddFromGuid

D

Denys

Good morning everyone,

For my project, the user must add from the Tools -Reference the
"Microsoft ActiveX Data Objects 2.0 Library" in the VBA window. This
is what was given to me.... However, it adds the "Microsoft Forms 2.0
Object Library".

Anyone would know which one is the good one? Or where I could find the
info?

ThisWorkbook.VBProject.References.AddFromGuid _
GUID:="{0D452EE1-E08F-101A-852E-02608C4D0BB4}", major:=2, minor:=0

Thank you for your time

Denys
 
P

Peter T

Manually add the appropriate reference, then -

With ThisWorkbook.VBProject.References("ADODB")
Debug.Print .Description ' Microsoft ActiveX Data Objects 2.0 Library
Debug.Print .Name, .major, .minor ' ADODB 2 0
Debug.Print .Fullpath ' path\msado20.tlb
Debug.Print .GUID ' {00000200-0000-0010-8000-00AA006D2EA4}
End With

Somewhere in this ng RB Smissaert posted a routine to add the latest ADODB
version available in user's system, might be worth a search. The respective
GUID's are not the same for later versions.

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top