Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel(2007) crashes on quering for DrawingObjects selection

Hi All,

I am trying to to capture a selected image from the excel (2007)sheet.
I am quering for DrawingObjects in the selection. Excel crashes in the
statement
'pDispatch-QueryInterface(__uuidof(MSExcel::DrawingObjects), (LPVOID*)&pDwo);'


Here is the piece of code that i am using

IDispatch *pDispatch = m_Application-GetSelection();

if (pDispatch == NULL)
return bRetVal;

CComQIPtr<MSExcel::Range ranges;
ranges = m_Application-GetSelection();

MSExcel::DrawingObjects * pDwo = NULL;
pDispatch-QueryInterface(__uuidof(MSExcel::DrawingObjects), (void
**)&pDwo);

When the last statment gets executed, excel crashes.

can anyone tell me i have missed anything to make it work on Office
2007 Excel

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Excel(2007) crashes on quering for DrawingObjects selection

I am not a C++ developer but I've found that to get some of my old VBA code
to run under XL2007 I had to replace some uses of DrawingObjects with
Shapes.

--
Jim
"ranga" wrote in message
oups.com...
| Hi All,
|
| I am trying to to capture a selected image from the excel (2007)sheet.
| I am quering for DrawingObjects in the selection. Excel crashes in the
| statement
|
'pDispatch-QueryInterface(__uuidof(MSExcel::DrawingObjects), (LPVOID*)&pDwo);'
|
|
| Here is the piece of code that i am using
|
| IDispatch *pDispatch = m_Application-GetSelection();
|
| if (pDispatch == NULL)
| return bRetVal;
|
| CComQIPtr<MSExcel::Range ranges;
| ranges = m_Application-GetSelection();
|
| MSExcel::DrawingObjects * pDwo = NULL;
| pDispatch-QueryInterface(__uuidof(MSExcel::DrawingObjects), (void
| **)&pDwo);
|
| When the last statment gets executed, excel crashes.
|
| can anyone tell me i have missed anything to make it work on Office
| 2007 Excel
|


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
Excel 2007 Crashes when Saving to .xls Diana Excel Discussion (Misc queries) 1 May 5th 10 08:53 PM
Excel 2007 Crashes D@SE Excel Discussion (Misc queries) 2 June 16th 09 04:56 PM
Excel 2007 Crashes rykkim Excel Discussion (Misc queries) 0 February 19th 09 09:33 PM
Excel 2007 crashes when converting to XLS SunsetKid Excel Discussion (Misc queries) 0 December 18th 08 02:42 AM
Excel 2007 Crashes Big Al Excel Discussion (Misc queries) 4 August 4th 06 08:11 AM


All times are GMT +1. The time now is 05:13 AM.

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

About Us

"It's about Microsoft Excel"