Set library reference from VBA code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Currently, to select/deselect a library reference, I open the Tools /
References menu option and click on/off the library that I need.

I am wondering if there is a way to select/deselect a library using VBA code
(i.e. without having to manually use the point and click method).

Any help is appreciated.

Thanks in advance.
Kevin
 
I understand how to add via the AddFromFile method but how from th
AddFromGUID method?
 
Each reference has a GUID associated with it, as well as a Major and Minor
property. You can store those properties, and then use then to add the
reference. For example, I've got a project that's using the Microsoft
Internet Controls.

I can add that reference programmatically using either

References.AddFromFile "C:\Windows\System32\shdocvw.dll"

or

References.AddFromGUID "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}", 1, 1

However, based on questions you've posted to other newsgroups, I'd recommend
you use Late Binding, rather than worrying about trying to add or remove
references based on what's installed on the user's workstation.
 
Back
Top