PDA

View Full Version : How to dynamically add an Office reference?



MDesigner
06-06-2005, 12:26 PM
I've got an issue that apparently came out of nowhere..

A bunch of our clients at a particular company have an Excel sheet we gave them that has some VBA code in it. Basically, they click a button on the Excel sheet, and the VBA code saves the Excel doc to a temp location, opens up a new Outlook compose window, and attaches the Excel doc to it. This uses the Outlook.Application object.

The problem is, out of nowhere, this functionality broke for them. It used to work fine. It SEEMS that they downgraded their Office, and so it's not finding the Outlook 11.0 Reference Lib anymore...

I heard that you can code VBA apps to look for either Office 10 or 11 references and add them dynamically. If anyone could tell me how this is done, I'd really appreciate it!

Thanks..

Ken Puls
06-06-2005, 01:10 PM
Hi there,

Some KB entries that may help...

Add a VBA Reference Library via code
Remove Missing VBA Library References via code
Determine the File Path or GUID to a VBA Reference Library

HTH,

MDesigner
06-06-2005, 01:19 PM
Thanks a million! I swear I searched first.. I tried searching for "outlook reference dynamically" and "outlook reference 11.0 10.0".. didn't turn up much. Guess I was searching for the wrong things.

Ken Puls
06-06-2005, 01:24 PM
You're welcome, and welcome to VBAX, but the way!

Our KB search engine is in the process of being upgraded right now, and should eliminate some searching issues. Hopefully it will make things easier to find things in the future. :yes

Cheers!