Question - Backward compatiblity in Office developing

Z

Zzzbla

Hi,

I have a project that automates Excel, and I make a reference to the
Excel library installed on my computer - Excel XP.

I would like my project to support older versions of Excel but if someone
doesn't have Excel XP it probably won't work.

Is there a way other than late-binding? (i.e. dim myexcel as Object: set
myexcel = CreateObject("Excel.Application") )

Please post an answer!

Thanks in advance!
 
C

Cindy Meister -WordMVP-

Hi Zzzbla,

You'd have to have the earliest version installed on a machine and set the
reference to that object library. When the project is opened on other
machines, with later versions, it should theoretically automatically connect
to the newer library.

In practice, this isn't always the case. One version of Office (2000, I
think it was) was particularly unreliable in this respect.

It's also possible to check a reference and, if it's missing, make the link.
For that you need to use the VBExtensibility object model (which will also
need a reference). Type VBComponent into a module, then press F1 to get into
the help. Look for topics like IsBroken, References and AddFromGUID.
I have a project that automates Excel, and I make a reference to the
Excel library installed on my computer - Excel XP.

I would like my project to support older versions of Excel but if someone
doesn't have Excel XP it probably won't work.

Is there a way other than late-binding? (i.e. dim myexcel as Object: set
myexcel = CreateObject("Excel.Application") )

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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