REFERENCES !!!

A

ACase

Hello,

I am deploying and Access DB. The DB was built in Office XP or 2002. The
user has Access 2003. The user is experiencing some errors, which we have
attributed to a difference in our references.

I have:
Microsoft Office 10.0 Object Library
Microsoft Excel 10.0 Object Library

User has:
Microsoft Office 11.0 object Library
MISSING: Microsoft Excel 10.0 Object Library.

Is there anything we can do - besides upgrading/downgrading the whold Access
application.

Any help would be much appreciated.

Thanks
Acase
 
6

'69 Camaro

If one is developing on one Access platform and deploying to another, then
the best thing to do is only set references for the default references and
use late binding for objects that need any other libraries. The Office and
Excel libraries aren't default libraries, so objects in your VBA code that
need these two libraries should use late binding instead.

For more information, please see MichKa's (former Access MVP) excellent
article, "How to guarantee that references will work in your applications" on
the following Web page:

http://www.trigeminal.com/usenet/usenet026.asp?1033

The Access 2003 default references when the MDB is in A2002/A2003 format are:

Visual Basic for Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.5 Library

The Access 2002 default references when the MDB is created in Access 2002
format are:

Visual Basic for Applications
Microsoft Access 10.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.5 Library.

The Access 2003 default references when the MDB is in A2000 format are:

Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.1 Library

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
6

'69 Camaro

Sorry. I missed one on that Access 2003 list. Here's a more complete list
of the default references:

The Access 2003 default references when the MDB is created in Access
2002/2003 format are:

Visual Basic for Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.5 Library

The Access 2003 default references when the MDB is created in Access 2000
format are:

Visual Basic for Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.1 Library

The Access 2002 default references when the MDB is created in Access 2002
format are:

Visual Basic for Applications
Microsoft Access 10.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.5 Library.

The Access 2002 default references when the MDB is created in Access 2000
format are:

Visual Basic for Applications
Microsoft Access 10.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
A

ACase

Thanks - Ok I now understand late/early binding.

I'm not an expert on this so... if I want to Late bind the Excel
functionality where do I add it.

Is this all I need?

Dim oXL As Object
Set oXL = CreateObject("Excel.Application")

What happens if the Excel Application is already open?
What do I need to do to work with Worksheets?

Thanks Again
Acase
 
6

'69 Camaro

Is this all I need?
Dim oXL As Object
Set oXL = CreateObject("Excel.Application")

What happens if the Excel Application is already open?
What do I need to do to work with Worksheets?

If Excel is already open, then one would want to check that first, instead
of creating a new instance of Excel. Here's an example:

http://www.mvps.org/access/modules/mdl0006.htm

This example needs the fIsAppRunning( ) function, which can be found on the
following Web page:

http://www.mvps.org/access/api/api0007.htm

Here's another example:

http://groups.google.com/group/micr...public.access.*&rnum=1&hl=en#dae3156d135910f7

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
D

Douglas J Steele

Another, somewhat simpler, approach is to assume it's open, and only create
it if it's not:

Dim oXL As Object

On Error Resume Next
Set oXL = GetObject(,"Excel.Application")
If Err.Number <> 0 Then

Set oXL = CreateObject("Excel.Application")
End If


You'd probably also want to set some sort of flag, so that you know not to
close Excel when you're done if it was already open (plus turn the Error
handling back on!)
 
T

Tony Toews

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