Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Shapes selection problem
Hi
I'm trying to determine which shapes (images in my case) are selected in Excel (Office 2007). However, attempting to get anything useful from the IDispatch returned from application-selection fails e.g. CComQIPtr<Excel::ShapeRange ShpRng = pAppXL-Selection; results in SHpRange being NULL. Has anyone actually succeeded in using the application Selection property in Excel from a COM addin, or is this a big bug in Excel? Incidentally, trying the window Selection property returns the same IDispatch, again with no useful interface. Thanks Steve H |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Shapes selection problem
Typically, I found the answer empirically, five minutes after posting:
If an image is selected you get either a pointer to a Picture or Pictures object, depending on whether one or more images is selected. So, with CComQIPtr<Excel::Picture pic = pAppXL-Selection; pic is none null if a single image is selected. Steve H On 24 Jan, 15:16, wrote: Hi I'm trying to determine which shapes (images in my case) are selected in Excel (Office 2007). However, attempting to get anything useful from the IDispatch returned from application-selection fails e.g. CComQIPtr<Excel::ShapeRange ShpRng = pAppXL-Selection; results in SHpRange being NULL. Has anyone actually succeeded in using the application Selection property in Excel from a COM addin, or is this a big bug in Excel? Incidentally, trying the window Selection property returns the same IDispatch, again with no useful interface. Thanks Steve H |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Bug, multiple selection of shapes | Excel Programming | |||
Selection order problem with code for shapes connection | Excel Programming | |||
Programmatically add shapes to a selection | Excel Programming | |||
Programmatically add shapes to a selection | Excel Programming | |||
Disable selection of shapes | Excel Programming |