So I am just reusing some code that works most of the time to reset the seriescollection of specific charts. Sometimes is will just error when I try to set the .values object to my range of values. It's strange because it will work for 10 seriescollections/identicle ranges on the same chart and then error out; and sometimes it will work perfectly.
I've checked:
The chart reference object
The range I'm setting
The code I've copied from
It's all correct. Here's a short sample.
On my new sheet here it won't set ANY values, which is a real problem. If anyone knows what is going on, please let me know. Thanks!
I've checked:
The chart reference object
The range I'm setting
The code I've copied from
It's all correct. Here's a short sample.
Code:
ValRng = Range("AR7:CY7")
Set usechart = ActiveSheet.ChartObjects(1)
With usechart.Chart.SeriesCollection.NewSeries
.Name = "Prime 2000"
.Values = ValRng ' (also tried it this way) "=" & ActiveSheet.Name & "!" & Range("AR7:CY7").Address
End with
On my new sheet here it won't set ANY values, which is a real problem. If anyone knows what is going on, please let me know. Thanks!