Discussion:
Reference to Excel TypeLibrary in Word
(too old to reply)
Peter
2004-09-03 21:40:51 UTC
Permalink
Hi,

I have a template in Word with a object typelibrary reference to Excel 10.0.
My template is also used by people with Ms Excel 9.0. type library. This
will cause an error if the excel code is processed. This can be avoided by
adding an error routine, but I want the template to work for both occasions
(9.0 and 10.0)

Is there a way that the reference can be checked through VBA, and, if
possible, is added to the project by VBA?

Thx.

Peter
Chad DeMeyer
2004-09-03 22:25:09 UTC
Permalink
I think it is possible, using VBA extensibility reference. But I think the
usual way of coding for multiple versions of Office is to use late binding.
You can set the reference during design time to get intellisense help with
the Excel object library, then remove the reference before releasing the
template. However, if you are using a reference to 10.0, be extra careful
that you aren't accessing objects, properties, and methods that were
introduced in that version, so a 9.0 user doesn't get compile errors.

Regards,
Chad
Post by Peter
Hi,
I have a template in Word with a object typelibrary reference to Excel 10.0.
My template is also used by people with Ms Excel 9.0. type library. This
will cause an error if the excel code is processed. This can be avoided by
adding an error routine, but I want the template to work for both occasions
(9.0 and 10.0)
Is there a way that the reference can be checked through VBA, and, if
possible, is added to the project by VBA?
Thx.
Peter
Loading...