LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
J S J S is offline
external usenet poster
 
Posts: 11
Default Error trying to set the name of series in a chart.

I have a chart in a worksheet, the chart is a stacked column chart with 6
series and I want to programmatically changed the names of each of the data
series. I can do this just fine if I do it manually. When I use the macro
recorder and try to run the recorded code I get the Following error: 1004
Unable to set the Name property of the Series class

I have no idea why this is the case, Interestingly enough when I use the on
error resume next, I find that I am able to change the name of the first
series and the sixth series with no problems but data series 2-5 all
generate the same error.

I am using excel 2000 on windows xp pro.

I will also post another message in reply to this one with the excel
spreadsheet and some testing code in a module(which I pasted below).

-J

Sub Macro1()
On Error Resume Next
Sheets("Acquisition (Donor Value)").Select
ActiveSheet.ChartObjects("Chart 2").Activate

ActiveChart.SeriesCollection(1).Name = "=""a1"""
Debug.Print "#1 " & Err.Number & " " & Err.Description
Err.Clear

ActiveChart.SeriesCollection(2).Name = "=""a2"""
Debug.Print "#2 " & Err.Number & " " & Err.Description
Err.Clear

ActiveChart.SeriesCollection(3).Name = "=""a3"""
Debug.Print "#3 " & Err.Number
Err.Clear

ActiveChart.SeriesCollection(4).Name = "=""a4"""
Debug.Print "#4 " & Err.Number
Err.Clear

ActiveChart.SeriesCollection(5).Name = "=""a5"""
Debug.Print "#5 " & Err.Number
Err.Clear

ActiveChart.SeriesCollection(6).Name = "=""a6"""
Debug.Print "#6 " & Err.Number
Err.Clear
End Sub


 
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
User Selectable Series and Number of Series for Line Chart Dave in NJ Charts and Charting in Excel 2 February 23rd 09 12:18 AM
how to plot column chart with one series against multiple series. svenkateshmurthy Charts and Charting in Excel 2 October 16th 07 09:09 PM
Error in chart with 2 different series... Morgs Charts and Charting in Excel 1 July 12th 07 10:41 AM
chart data series -- plot a table as a single series hjc Charts and Charting in Excel 7 September 20th 05 05:52 PM
How to I incorporate SD from a data series into chart error bars? carlosPharm.D Charts and Charting in Excel 5 August 2nd 05 09:27 PM


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

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"