Controlling project references in code

B

Bo Hansson

I need an example that explains how to add and remove project references in
VBA code.

/BosseH
 
J

Jonathan West

Bo Hansson said:
I need an example that explains how to add and remove project references in
VBA code.

/BosseH

Hi Bo,

You can add a reference to a probject using the
VBProject.References.AddFromGuid method. You need the GUID of the ActiveX
control in order to add it to the list.

You can also use the Remove method of the references collection to remove a
reference. Code samples are available in the VBA Help file.
 
B

Bo Hansson

Thanks Jonathan,

However, I must say that I cannot find any good samples in the VBA Help
file.
And furthermore, my prime mission will probably be to recognise any missing
references, and then try to supply the targets of these or completely remove
them.
A couple of years ago I saw some tricky samples of how to do this, but now I
cannot remember where, and - one might hope that methods available today are
better and easier to use.

/BosseH
 
T

Tom Winter

Look at my post in microsoft.public.word.vba.addins under "problem with
reference being replicated"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top