Programmatically Adding References

S

Sean

Is there a way to programmatically add references to a project? I have this
control (Microsoft Calendar Control) added on my machine but when I transfer
my template to another user, I get an error.

I tried this code to add a reference but I get the following error:

Application.VBE.ActiveVBProject.References.AddFromFile
("C:\windows\system32\mscal.ocx")

'Programmatic access to VB Project is not trusted.'

Is there a way to do this outside of adding the reference manually for each
user?
 
J

Jezebel

Set your security to 'Trust Access to VB Project' (Tools > Macro > Security
: Trusted publishers tab)
 

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