method add of workbook fails

C

Cheryl Bender

I have some code in an Access 2003 database that has performed fine in
Access
2007 until very recently. In fact it performs on at least one computer
with
Access 2007 but not on the other. Both are SP2. I have tried
uninstalling and reinstalling office as well as the Service Pack but
it doesn't seem to do a clean uninstall (security settings are still
the same after the reinstall).

The references are identical (previously I was using late binding with
no
reference to Excel, but that does not seem to make any difference)

Both computers have the same office version, same VBAJet32.dll version
but
very different list of updates. The code is as follows

Dim oXL As Object
Dim oWB As Object

Set oXL = CreateObject("Excel.Application")
Set oWB = oXL.workbooks.Add

Set oWB = Nothing
Set oXL = Nothing

It failes on the oXL.workbooks.Add line with the error "method 'add'
of
object 'workbooks' failed.

Hope someone can point me in the right direction on what to
look for, as I'm afraid I will have this issue on other computers as
well.

Thanks in advance
Cheryl
 

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