Access VBA Object Reference

C

cronse

The problem that I am having is that some computers in our office
have
office xp and others have office 2003. I made and access database
that has a bunch of vb behind it in office 2003. When I got to run
it
in office xp it blows up. Under the references tab it says that it
is
MISSING:Excel 11.0 Object Reference Library. Is there a way to use
that library under office xp.

Thanks in advance.


Chris
 
N

Norman Yuan

Excel11.0 Object Library means Excel2003. The same library for OfficeXP is
10.0. If you want to have your access application to work with multple
version of MS Office, then you need to develop it against oldest target
version. In your case, you should develop in Office XP. It may be fine to
use Access2003, because its format is the same as AccessXP(2002), but if you
need to set reference to Excel object library (meaning installing OfficeXP),
you need to use the oldest version of your target, in your case, Excel2002.

Of course, you can consider using late binding to handle multiple version
issue (if you now what it is).
 
T

Tony Toews [MVP]

Under the references tab it says that it is
MISSING:Excel 11.0 Object Reference Library. Is there a way to use
that library under office xp.

To add to Norman's comment on late binding.

Late binding means you can safely remove the reference and only have
an error when the app executes lines of code in question. Rather than
erroring out while starting up the app and not allowing the users in
the app at all. Or when hitting a mid, left or trim function call.

You'll want to install the reference if you are programming or
debugging and want to use the object intellisense while in the VBA
editor. Then,. once your app is running smoothly, remove the
reference and setup the late binding statements.

Sample code:
' Declare an object variable to hold the object
' reference. Dim as Object causes late binding.
Dim objWordDoc As Object
Set objWordDoc = CreateObject(" Word.Document")

For more information including additional text and some detailed links
see the "Late Binding in Microsoft Access" page at
http://www.granite.ab.ca/access/latebinding.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
C

cronse

To add to Norman's comment on late binding.

Late binding means you can safely remove the reference and only have
an error when the app executes lines of code in question. Rather than
erroring out while starting up the app and not allowing the users in
the app at all. Or when hitting a mid, left or trim function call.

You'll want to install the reference if you are programming or
debugging and want to use the object intellisense while in the VBA
editor. Then,. once your app is running smoothly, remove the
reference and setup the late binding statements.

Sample code:
' Declare an object variable to hold the object
' reference. Dim as Object causes late binding.
Dim objWordDoc As Object
Set objWordDoc = CreateObject(" Word.Document")

For more information including additional text and some detailed links
see the "Late Binding in Microsoft Access" page athttp://www.granite.ab.ca/access/latebinding.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems athttp://www.granite.ab.ca/accsmstr.htm

Thank you very much.
 

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