Office App References w/Different Versions

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

My company has Office 2k, XP, and '03 running on various
desktops. I'm (on and Office '03 machine) try to develop
an MS Access app with some MS Excel references in it. I
gave the file to someone with an Office 2k machine and
they got errors regarding not having Excel 11.0. How can
I make the Excel reference not so version specific?
Thanks,
Dan
 
One solution is to use late binding.

Instead of declaring the specific kind of object you want, just declare an
Object:
Dim obj As Object
Then the object and its properties and methods will be resolved at runtime,
based on the appropriate library, instead of being bound to a specific
object of a specific library at design time.
 
That did the trick. Thanks.
-----Original Message-----
One solution is to use late binding.

Instead of declaring the specific kind of object you want, just declare an
Object:
Dim obj As Object
Then the object and its properties and methods will be resolved at runtime,
based on the appropriate library, instead of being bound to a specific
object of a specific library at design time.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.




.
 
Back
Top