PC Review


Reply
 
 
Kieran H
Guest
Posts: n/a
 
      6th Jan 2009
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 With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      6th Jan 2009
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access automation leaves Excel open which in turn locks 2nd automation attempts EagleOne@discussions.microsoft.com Microsoft Access 8 30th Jun 2008 01:27 AM
Supressing the ctrl-c and other keys during word automation in automation apondu Microsoft Dot NET 0 19th Jul 2007 10:15 PM
Supressing the ctrl-c and other keys during word automation in automation apondu Microsoft C# .NET 0 19th Jul 2007 10:15 PM
Supressing the ctrl-c and other keys during word automation in automation apondu Microsoft Word Document Management 0 19th Jul 2007 10:15 PM
Supressing the ctrl-c and other keys during word automation in automation apondu Microsoft ASP .NET 0 19th Jul 2007 10:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:46 PM.