Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default Looping Through Charts / ChartObjects

Hi, I know the last paragraph below has a bad syntax, but what I want to do
is loop through charts on all worksheets and print the formulas of each of
the charts' series. I DO NOT want to activate the chart, can you please
repair my syntax/object references? Thanks!!!!!!!

Dim ch As Chart
Dim chObj As Object
Dim Sh As Worksheet
Dim Ser As Series

'This code works fine for chart sheets
For Each ch In ThisWorkbook.Charts
For Each Ser In ch.SeriesCollection
Debug.Print Ser.Formula
Next Ser
Next ch

'This code FAILS for charts embedded in worksheet (not a chart sheet)
For Each Sh In ThisWorkbook.Worksheets
For Each chObj In Sh.ChartObjects
For Each Ser In chObj.SeriesCollection 'This property donesn't
exist!!
Debug.Print Ser.Formula
Next Ser
Next chObj
Next Sh



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Looping Through Charts / ChartObjects

HI William Benson,

For Each Ser In chObj.Chart.SeriesCollection

Ed Ferrero
http://edferrero.m6.net

Hi, I know the last paragraph below has a bad syntax, but what I want to
do is loop through charts on all worksheets and print the formulas of each
of the charts' series. I DO NOT want to activate the chart, can you please
repair my syntax/object references? Thanks!!!!!!!

Dim ch As Chart
Dim chObj As Object
Dim Sh As Worksheet
Dim Ser As Series

'This code works fine for chart sheets
For Each ch In ThisWorkbook.Charts
For Each Ser In ch.SeriesCollection
Debug.Print Ser.Formula
Next Ser
Next ch

'This code FAILS for charts embedded in worksheet (not a chart sheet)
For Each Sh In ThisWorkbook.Worksheets
For Each chObj In Sh.ChartObjects
For Each Ser In chObj.SeriesCollection 'This property donesn't
exist!!
Debug.Print Ser.Formula
Next Ser
Next chObj
Next Sh





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default Looping Through Charts / ChartObjects

Perfect, thank you Ed.


"Ed Ferrero" wrote in message
...
HI William Benson,

For Each Ser In chObj.Chart.SeriesCollection

Ed Ferrero
http://edferrero.m6.net

Hi, I know the last paragraph below has a bad syntax, but what I want to
do is loop through charts on all worksheets and print the formulas of
each of the charts' series. I DO NOT want to activate the chart, can you
please repair my syntax/object references? Thanks!!!!!!!

Dim ch As Chart
Dim chObj As Object
Dim Sh As Worksheet
Dim Ser As Series

'This code works fine for chart sheets
For Each ch In ThisWorkbook.Charts
For Each Ser In ch.SeriesCollection
Debug.Print Ser.Formula
Next Ser
Next ch

'This code FAILS for charts embedded in worksheet (not a chart sheet)
For Each Sh In ThisWorkbook.Worksheets
For Each chObj In Sh.ChartObjects
For Each Ser In chObj.SeriesCollection 'This property donesn't
exist!!
Debug.Print Ser.Formula
Next Ser
Next chObj
Next Sh







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
ChartObjects Nick Excel Programming 2 August 19th 04 12:04 PM
Looping through charts in a worksheet Grant Excel Programming 1 August 6th 04 09:22 AM
Looping through to stop on pie charts Daniel Bonallack[_2_] Excel Programming 1 July 13th 04 06:11 PM
Looping Through Charts Mike Waldron[_2_] Excel Programming 1 May 21st 04 06:21 PM
Looping Through Charts No Name Excel Programming 1 May 20th 04 10:36 PM


All times are GMT +1. The time now is 08:25 PM.

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"