Excel version reference problem

R

R Avery

I have created an addin in XL 2002, and I am now about to distribute it
to users, but some of the users use XL 2000. These users have
complained that the add-in does not work because of reference errors.
Is there any way to programmatically fix the references when loading
(e.g., if Excel 10.0 Library is not available, try to load Excel 9.0
Library)?

Any help would be most appreciated.
 
J

Jon Peltier

The way I handle this, which is probably not optimal, is to use late
binding. Set no references, and declare your variables as Object instead
of the library-specific types. You don't get autosense in the VB Editor,
so you could convert to late binding at the end of development, and
supposedly late bound apps run more slowly. But it's faster than if it
throws an error, eh?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
R

R Avery

I don't suppose you have an automated way to convert all variables to
Object and to replace all set MYVAR = New MyObject to set MYVAR =
createobject("MyRef.MyOjbect") at the end of development?

In my environment, rapid application development is much more important
than run-time (since it is not very computationally intensive), and so I
definitely need the VBE's IntelliSense autocompleting everything... and
so a utility as defined above would definitely be of use.
 
J

Jon Peltier

I don't have such a thing, nor have I heard of one. I use the MYVAR =
createobject("MyRef.MyOjbect") whenever possible even with early bound
projects, so that's one thing I need not change.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

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