Here's my problem:
I have an AutoCad VBA project that incorporates Excel functions. Our
workstations currently have three different versions of Excel (2000, 2002,
and XP), but only one AutoCad version, actually ADT 3.3.
I repeatedly had problems with the project not finding the proper Excel
reference, so I isolated the Excel-related functions in a separate project,
then created three copies of it, one for each Excel version, with the
references set up in each. I then removed the Excel reference entirely from
my main project. When the user calls a function that uses Excel, the main
program determines the Excel version on the workstation, then loads the
appropriate project and runs the function.
Obviously this is a huge pain. Any changes in the Excel projects have to be
made in three different files, using three different computers (one for each
Excel version) to keep the references straight.
I recently tried determining what Excel version is installed before the main
project loads, then adding the proper Excel reference programatically
application.VBE.vbprojects("projname").references. addfromfile("whatever")
This works fine, except on exiting AutoCad, the user is prompted to save the
changes to the VBA project. The .dvb file is read-only, so there's no danger
of someone messing it up, but the prompt is useless, confusing and annoying.
Anybody got any ideas on how to deal with this situation? Any help will be
greatly appreciated.


Reply With Quote