Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automation
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automation
Instead of:
Set xlBook = xlAPP.Workbooks.Add Try: xlAPP.Workbooks.Add "Kieran H" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Supressing the ctrl-c and other keys during word automation in automation | Excel Programming | |||
Automation | Excel Worksheet Functions | |||
automation | New Users to Excel | |||
Automation | Excel Programming | |||
Automation | Excel Programming |