Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default selecting a chart

how can i find out i a selection has a chart or not?
Regards
Chimanrao

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default selecting a chart

If typename(selection) = "Chart" then

Based on a later question, perhaps you are trying to see if a chart is
located over the selection (cells don't contain charts). You can do this

if the selection is a range of cells:

Dim cobj as ChartObject, rng as Range
for each cobj in Activesheet.ChartObjects
set rng = Range(cobj.topLeftCell,cobj.BottomRightCell)
if not intersect(rng,selection) is nothing then
msgbox cobj.Name & " is located over selection"
end if
Next

--
Regards,
Tom Ogilvy


"Chimanrao" wrote in message
oups.com...
how can i find out i a selection has a chart or not?
Regards
Chimanrao



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default selecting a chart

what is the typename equivalent in COM?
I get a IDispatch pointer when I do GetSelection on the application
object.
If i do a QueryInterface for the _Chart interface, i get a null .

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default selecting a chart

what is the typename equivalent in COM?
in com the selection is returned as a IDispatch pointer.
When I do a query interface on it for _Chart, it fails.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default selecting a chart

what is the typename equivalent in COM?
in com the selection is returned as a IDispatch pointer.
When I do a query interface on it for _Chart, it fails.



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
Selecting an Embedded Chart Je Charts and Charting in Excel 2 April 2nd 09 05:31 PM
Selecting a chart, colors disappear. Brad Charts and Charting in Excel 0 May 9th 07 06:32 PM
Selecting part of a series for a chart? Al Charts and Charting in Excel 6 May 16th 06 12:45 PM
Selecting data from different cells for a chart Need Help in DC Charts and Charting in Excel 2 March 7th 06 12:00 AM
Selecting row data for chart - Not sure what I did right mcatan Excel Programming 1 September 1st 04 06:44 PM


All times are GMT +1. The time now is 03:37 PM.

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"