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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Are the Tools/References for DLL Registration included in a collection 1

Status
Not open for further replies.

SBendBuckeye

Programmer
May 22, 2002
2,166
US
One of the things that periodically bites me is forgetting to add a DLL reference to a project. I have written some code to spin the Access collections and report on forms, tabledefs, indexes, relations, etc.

I would like to add a piece to report on DLL's registered via the Tools -> References menu option. That way I can do a quck double check when I copy something out of my toolkit into a different project.

Can someone point me how to do this?

Thanks in advance for any help!
 
The following code will report on all references set for the active VBProject :
Code:
Sub ShowVBProjRefs()
Dim refVBE
Dim strRefs As String
    For Each refVBE In Application.VBE.ActiveVBProject.References
    strRefs = strRefs & refVBE.GUID & vbTab & refVBE.FullPath & vbCrLf
    Next refVBE
    MsgBox strRefs, Title:="Active VBProject References"
    Set refVBE = Nothing
End Sub
If using Office XP, you may need to change your security settings to allow access to the VBProject via code, as by default such access is disabled.

A.C.
 
Sorry,

For a little more info amend the code to :
Code:
Sub ShowVBProjRefs()
Dim refVBE
Dim strRefs As String
    For Each refVBE In Application.VBE.ActiveVBProject.References
    strRefs = strRefs & refVBE.Name & vbTab & _
                refVBE.GUID & vbTab & _
                refVBE.FullPath & vbCrLf
    Next refVBE
    MsgBox strRefs, Title:="Active VBProject References"
    Set refVBE = Nothing
End Sub
This includes in actula name of the reference, which might be more informative thann the GUID or Filename.

A.C.
 
Hey Acron,

Thanks a lot! That is exactly the type of thing I was looking for. If you send an email to landgwiney@characterlink.net, I'll try to remember to send you a copy of the System Information project I'm working on when I get it done.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top