List References


Home           Programming       Favorites      
Paste the following code into Module 1.

Place your cursor on any line inside of the code that you just pasted int Module 1.
Sub ListReferences()

   Dim VBAEditor As VBIDE.VBE
   Dim VBProj As VBIDE.VBProject

   Set VBAEditor = Application.VBE
   Set VBProj = VBAEditor.ActiveVBProject

   For Each chkRef In VBProj.References
      Debug.Print chkRef.Name
   Next

End Sub				
Strike the F8 function key.  Every time you strike it, the program will execute the code on the highlighted line and step to the next line of code.

Every time the Debug.Print chkRef.Name line is executed, you should see a new reference listed in the Immediate Window.

This procedure should work in any Office application.