Land Of Oorang

Or "Things Only I Will Think Are Important"

Blog

How to Output all Project References Using the Immediate Window

Posted by Oorang on November 25, 2009 at 2:50 PM

It's often useful to document, either in a module or in a post, the referencs needed to make the module (or code snippet work). Unfortunately you can't copy the path's and names from the references window. Here is a nice and easy way to get the information you need.


  1. Press Ctrl-G to open the Immediate Window.
  2. Paste this: 
    For Each r in Application.VBE.ActiveVBProject.References:?"'"&r.Name,r.FullPath:Next
  3. Press Enter, and enjoy:)

Some people (me) like this format better, it's a little longer though:
For Each r in Application.VBE.ActiveVBProject.References:?"'"& vbTab+"-"&r.Description:?"'"&vbTab+" "&r.FullPath:Next


 



Categories: VBA

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

Already a member? Sign In

0 Comments