Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I Get, Store and Set Object Reference Libraries

Status
Not open for further replies.

BillDickenson

IS-IT--Management
Mar 21, 2005
29
US
I wrote a program that we have deployed around a couple of people. However, about 1 in 3, I have to manually go in and fix the references library.

It would be nice if I could run a query of the libraries, in the main db, store the results, then run a program to set them on the new client. I realize that may screw up other programs, but most of these folks are only running one !

I saw a lot about automatically updating, but not as many about creating a list. Then of course, there is the file path problem (no doubt different one each) but if someone can point me at the ability to list in access, I think there is enough to let me get the rest to work.
Thaks
 
Code:
Dim objRef As Reference
For Each objRef In Application.VBE.ActiveVBProject.References()
   MsgBox objRef.Name & "  " & objRef.FullPath
Next

will just displays the reference and its full path. Obviously you could take this and build a list of all relevant references.

Also look at the IsBroken property for a reference. You can check if the reference is, well, broken.

Gerry
 
Thanks. That sounds like the right idea. I've not seen the Application.VBE.ActiveVBProject.References() call before in Access. Thanks again
 
Here a Access version:
Sub ReferenceInfo()
Dim strMessage As String
Dim strTitle As String
Dim refItem As Reference
On Error Resume Next
For Each refItem In References
If refItem.IsBroken Then
strMessage = "Missing Reference:" & vbCrLf & refItem.FullPath
Else
strMessage = "Reference: " & refItem.Name & vbCrLf _
& "Location: " & refItem.FullPath
End If
Debug.Print strMessage
Next refItem
End Sub

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Outstanding, I see enough posts on setting it so I should be able to make this function. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top