Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Querying Properties programmatically BizMark Excel Discussion (Misc queries) 0 June 19th 06 04:17 PM
Deleting rows programmatically David Bateman Excel Worksheet Functions 1 March 6th 05 02:10 AM
Programmatically Add Reference` keepitcool Excel Programming 1 September 16th 03 05:30 PM
Selecting Rows Programmatically Aaron Lampkin Excel Programming 1 September 5th 03 01:42 PM
Can i set a reference programmatically? Tom Ogilvy Excel Programming 1 August 19th 03 04:24 PM


All times are GMT +1. The time now is 03:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"