Calling excel8.olb from Access

A

Andy

Now this one has got me baffled.

I am trying to start a new Excel application from Access VBA code - easy.
I'm using :-

Dim objXL As Excel.Application

Set objXL = New Excel.Application ' Start Excel

Trouble is, for the majority of my users this works fine - they have Ver
8.0a of excel8.olb but a few people have Ver 8.0.1.4307 of excel8.olb and it
causes an error 48: (DLL missing).

All the references (e.g. to the Excel 8.0 Object library) are OK.

Is there another DLL, that I am not aware of, that is missing?

Any ideas?
 
D

Douglas J. Steele

I'm assuming that you've added a reference to Excel (Tools | References when
you're in a code module). Does the reference look okay on those users who
get the error, or is it marked "MISSING:"?

You may be best off using Late Binding. Remove the references, and replace
the 2 lines of code you show with:

Dim objXL As Object

Set objXL = CreateObject("Excel.Application") ' Start Excel

The problem with this, of course, is that you don't get access to any of the
built-in constants in Excel. Compiling the application will identify all
such cases. You'll have to either define the constants yourself, or replace
all references to each constant with its actual value.
 
A

Andy

Great - thanks

Douglas J. Steele said:
I'm assuming that you've added a reference to Excel (Tools | References when
you're in a code module). Does the reference look okay on those users who
get the error, or is it marked "MISSING:"?

You may be best off using Late Binding. Remove the references, and replace
the 2 lines of code you show with:

Dim objXL As Object

Set objXL = CreateObject("Excel.Application") ' Start Excel

The problem with this, of course, is that you don't get access to any of the
built-in constants in Excel. Compiling the application will identify all
such cases. You'll have to either define the constants yourself, or replace
all references to each constant with its actual value.
 

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