References between versions

J

Jonathan Coates

I look after an Access application which requires
references to Excel, Word and Outlook.

As several of our users have differig versions of Office,
is there a way of forcing the references to update with
the installed version rather than having to comile one of
each?

Access seems to be OK going from 9 to 10 or 11 but not the
other way, and not always that way!
 
R

Ron Weiner

Jonathan

You can rewrite the app to use "Late Binding" instead of setting a reference
and using "Early Binding".

Instead of
Dim objYourObject as Word.Document
Set objYourObject = New Word.Document

Use
Dim objYourObject as Object
Set objYourObject = CreateObject("Word.Document")

This way you avoid setting any reference(s) at design time. All of the
references are set at run time, and no matter what version of Word (in the
example above) the user has will be used. You take a slight hit in
performance when you create the objects at run time this way, and all of
cool developer intellisense stuff is gone, but the I have found additional
compatibility afforded by this method is worth it.

Ron W
 
D

david epsom dot com dot au

Access seems to be OK going from 9 to 10 or 11 but ...
... not always ...

Perhaps it works ok in that direction /if/ office is
installed in the same folder.

(david)
 

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