Thread: ChartObjects
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Sean[_11_] Sean[_11_] is offline
external usenet poster
 
Posts: 17
Default ChartObjects

I think that ChartObjects only applies to embedded charts i.e. those
whose location is a worksheet and not those that are seperate
chartsheets. You probably need to check for the existence of charts
under both possibilities .


'+++++++++++++++++++++++++++++++++++++++++++++++++ +++++
Dim ws As Worksheet, ch As Chart, chOBJ As ChartObject

' get the names of all the chartsheets
For Each ch In ActiveWorkbook.Charts
Me.ListBox.AddItem ch.Name
Next ch

' get the names of all the embedded
For Each ws In ActiveWorkbook.Worksheets
For Each chOBJ In ws.ChartObjects
Me.ListBox.AddItem chOBJ.Chart.Name
Next chOBJ
Next ws
'+++++++++++++++++++++++++++++++++++++++++++++++++ +++++

----
Sean
"Just press the off switch, and go to sleep!"

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!