Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programmatically Add Reference`
Hi,
Here is a code that I saw on the web that was use to load ADO lib. I kept it in case but I never try it. Change it for the lib you're looking for. Sub Activate_ADORef_IfMissing() Dim vbpRef As Object Dim i As Integer, r As Integer Dim Ref As String, refFile As String Set vbpRef = ThisWorkbook.VBProject.References Ref = "*ActiveX Data Objects 2.*" refFile = "C:\Program Files\Common Files\System\ado\msado15.dll" ' ADO 2.7 On Error Resume Next For i = 1 To vbpRef.Count If vbpRef.Item(i).Description Like Ref Then Exit Sub Next vbpRef.AddFromFile refFile End Sub Let me know if it works. -- JP http://www.solutionsvba.com "JohnV" wrote in message ... I have a spreadsheet that will be used by different Admins. As they have varying levels of technical knowledge I would like to be able to check the references when the workbook is opened and see if the references to "Microsoft Outlook X.X Library" is checked. As the users can be using Office 97, 2000 or XP and I am not sure exactly what reference I am looking for; I probably need to check for all 3. Additionally, I am not sure where the reference library would be kept, so I would like to refer to the Library name rather than the location. Could anybody help me with this? Thanks, JohnV |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Querying Properties programmatically | Excel Discussion (Misc queries) | |||
Deleting rows programmatically | Excel Worksheet Functions | |||
Programmatically Add Reference` | Excel Programming | |||
Selecting Rows Programmatically | Excel Programming | |||
Can i set a reference programmatically? | Excel Programming |