Reference Library Upgrading

J

J Streger

Is there any way to stop Excel 2007 from upgrading reference libraries? I
know probably not but I am getting fed up with the knowledge that I cannot
utilize the MS Outlook library in any sheets that may be used by both 2003
and 2007 (Currently we have both where I work, which is HIGHLY annoying).

To explain, if I create a sheet in 2003, I can add MS Outlook Lib 11.0. If a
2007 person opens it, it permanently upgrades to library to 12.0. Then if a
2003 opens the sheet, the code fails and the reference needs to be reset.
This is what I want to stop. It's especially bad with shared sheets as it
causes a fatal corruption in the file, since the library is still updated
even if the sheet is shared. VBA gets stripped out in order to recover it in
2003.

So any solutions out there?

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

User of MS Office 2003
 
A

Alan Moseley

Your answer is perfectly good, providing that you don't need to hook into an
Outlook event. I cannot seem to find any sample code which describes how one
would, for example, act upon an ItemSend event when you have late-bound your
Outlook Application object.
 
J

J Streger

Thanks. I always try to avoid late binding application objects as it's so
much more elegant to tie in the reference, but in this case I can see the
benefit. Thanks.

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

User of MS Office 2003
 
P

Peter T

As you say, to trap events you need to set a reference to the object
library. Typically such event code would be in an addin that would unlikely
be re-distributed. Providing you as the developer set the reference to the
lowest version of Outlook of any potential user there shouldn't be a
problem.

Developers tend to have multiple versions of Office and will normally have
an appropriate "old" version. However Outlook poses a problem as only be one
version of Outlook can be installed, typically of course that of the newest
version of Office on the system.

Unfortunately it can be difficult if not impossible to programmatically
remove a "too new" reference before replacing with a valid one. One
workaround might be to distribute the addin without the reference. In the
open event check some flag if the reference has been previously added, if
not add the reference and save a flag (hidden cell, registry etc). User must
have "Trust access to VB project allowed".

Regards,
Peter T
 

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