On Error Resume Next
ThisWorkbook.VBProject.References.AddFromGuid _ GUID: = "(00000200-0000-0010-8000-00AA006D2EA4)", major: = 2, minor: = 0
To find the name of the library 'ADODB' is added manually reference that are necessary in the window of the code editor/menu/tools/references/
In the Object Browser (F2 keyboard shortcut) in the drop-down list identified "all libraries" were the names of all libraries loaded. When a selection is added to the bottom of the window, some information that guide the user
Library ADODB 'His name
'Location and the file responsible for the library C:\Program Files\Common Files\system\ado\msado20.tlb
'Descriptive name of the library as seen in the "References"
Microsoft ActiveX Data Objects 2.0 Library
And to find the parameters of the command line, the procedure is as follows:
Code:
Sub test ()
With ThisWorkbook.VBProject.References ( "ADODB")
Range ( "A1"). Value =. GUIDs
Range ( "A2"). Value =. Major
Range ( "A3"). Value =. Minor
End With
End Sub
Bookmarks