Automation

K

Kieran H

I am opening an instance of Excel 2007 from Access 2007

Set xlAPP = CreateObject("Excel.Application")
Set xlBook = xlAPP.Workbooks.Add
Set xlSheet = xlBook.Worksheets(1)

Unfortunately the Set xlBook = xlAPP.Workbooks.Add causes our
document management software to ewrror.

My guess is that the "Add" method somehow by passes the DM code that
would have been run had the workbook been opened.

I cannot trap the error - [object referenced without first being set]
as its not ocurring in my code

Can I use an "Open" method instead of "Add" to open a default new
workbook without the workbook existing or would I have to create the
workbook first.

As a workaround I have created an empty .xlt and use the open method
- this is not ideal as it creates a dependency on the empty file

Any thoght appreciated

Cheers

Kieran
 

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