Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
um um is offline
external usenet poster
 
Posts: 12
Default _Application.GetThisWorkbook() in a C++ add-in

Hello comrades,

I need to get an OLE reference to the worksheet of the instance of Excel
which called this add-in. I am using the following:

_Application pExcelApp;
Workbooks pWorkbooks;
pExcelApp.CreateDispatch("Excel.Application");
pWorkbooks=pExcelApp.GetThisWorkbook();

The last line crashes "Can not get GetThisWorkbook() of this application..."

_Application and Workbooks are defined in excel8.cpp and excel8.h. The
pExcelApp object is instantiated, since I can do other things with it and it
looks good.

What am I doing wrong???

Thanks a mille!!

um


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to cast ..Excel.ApplicationClass to ..Excel._Application yh Excel Discussion (Misc queries) 0 April 27th 10 07:08 AM
1004 Method 'COMAddIns' of object '_Application' failed matt Excel Programming 0 December 15th 03 05:23 PM
1004 method 'COMAddIns' of object '_Application' failed matt Excel Programming 0 December 15th 03 02:32 PM
Method 'ActivePrinter' of object '_Application' failed kiat Excel Programming 0 August 18th 03 03:45 PM


All times are GMT +1. The time now is 04:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"