Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Displaying series information for embedded charts

I have the following procedure to extract information on the chart series in
embedded charts. I get the following error:

Unable to get the formula property of the series class.

The error appears to occur when there is no data to graph for the series in
question. Is there something I can change within the code to get series
information when there is no data to graph?

Thanks

Sub ChartSeriesListEmbedded()
Dim sht As Worksheet
Dim objCht As ChartObject
Dim xVal, yVal, seriesformula
Dim k, i
Dim lastrow
Dim CurBook

CurBook = Application.ActiveWorkbook.Name
ActiveWorkbook.Unprotect
Worksheets.Add.Name = "SeriesList"
'lastrow = Worksheets("SeriesList").Cells(Rows.Count, "a").End(xlUp).row
lastrow = 0

For Each sht In ActiveWorkbook.Worksheets
sht.Activate
Debug.Print sht.Name
For Each objCht In sht.ChartObjects
Debug.Print objCht.Name
With objCht.Chart
For k = 1 To .SeriesCollection.Count
'xVal = .SeriesCollection(k).XValues
'yVal = .SeriesCollection(k).Values
seriesformula = .SeriesCollection(k).Formula
'Debug.Print sht.Name; " has chart; "; .Parent.Name; _
".; Series"; k; "; formula"; seriesformula
Workbooks(CurBook).Worksheets("SeriesList").range( "a" & lastrow + 1).Value =
sht.Name
Workbooks(CurBook).Worksheets("SeriesList").range( "b" & lastrow + 1).Value =
..Parent.Name
Workbooks(CurBook).Worksheets("SeriesList").range( "c" & lastrow + 1).Value = k
Workbooks(CurBook).Worksheets("SeriesList").range( "d" & lastrow + 1).Value =
"'" & seriesformula
lastrow = lastrow + 1
Next k
End With
Next
Next sht
End Sub
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
Embedded web graphics not displaying Smorabito Excel Discussion (Misc queries) 0 April 9th 10 06:25 PM
Charts switch from 'Series in Rows' to 'Series in Columns' Peace Charts and Charting in Excel 4 March 22nd 07 03:52 AM
Changing series information for approximately 60 series in a workb Barb Reinhardt Charts and Charting in Excel 2 January 18th 06 10:22 PM
Displaying cell references next to embedded cells in Word 2000 The Consigliere New Users to Excel 1 April 9th 05 02:58 PM
Displaying embedded chart on userform Bill Renaud[_2_] Excel Programming 2 April 6th 04 11:16 AM


All times are GMT +1. The time now is 11:36 AM.

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"