Unable to set the Name property of the Series class

strorg

Board Regular
Joined
Mar 27, 2002
Messages
112
In the snippet below, the selected sheet is a chart sheet. Code has started crashing on the [.SeriesCollection(1).Name =] line with the message "Unable to set the Name property of the Series class" even after successfully setting the Values property. The named range "S2Name" does exist. What am I missing here?

Thanks....Tom


Private Sub YTDUtilChartSetup()

Sheets("YTDUtilChart").Select
With ActiveChart
'Remove existing series to avoid errors due to lost references
i = .SeriesCollection.Count
Do Until i < 1
.SeriesCollection(i).Delete
i = i - 1
Loop

'Add new series for Normalized Utilization
.SeriesCollection.NewSeries
.SeriesCollection(1).Values = _
"=Summary!" & Range("YTDSeries2").Address(ReferenceStyle:=xlR1C1)
.SeriesCollection(1).Name = _
"=Summary!" & Range("S2Name").Address(ReferenceStyle:=xlR1C1)
.SeriesCollection(1).XValues = _
"=Summary!" & Range("ArchiveDateRange").Address(ReferenceStyle:=xlR1C1)
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
It worked for me. I think it must be that the name does not exist. Check it out:

MsgBox Range("S2Name").Value
 
Upvote 0
Solved:

The new series was being created on a range that had no data.

Thanks for testing and replying!

Tom
This message was edited by strorg on 2003-02-06 09:59
 
Upvote 0

Forum statistics

Threads
1,215,038
Messages
6,122,798
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top