3D surface chart - recorded macro error

Joined
Aug 13, 2008
Messages
2
Reaction score
0
Hi everyone,

I recorded a macro on 3D surface plotting using Excel 2003. When I tried to run it again it gives me an error:
Error 1004: Unable to set the XValues property of series class

The recorded Macro is:

Sheets("Output").Activate
Range("B2142:F2145").Select
Charts.Add
ActiveChart.ChartType = xlSurface
ActiveChart.SetSourceData Source:=Sheets("Output").Range("B2142:F2145"), _
PlotBy:=xlColumns

'ActiveChart.SeriesCollection(1).XValues = "=Output!R2142C1:R2145C1"
ActiveChart.SeriesCollection(1).Name = "=Output!R2141C2"
'ActiveChart.SeriesCollection(2).XValues = "=Output!R2142C1:R2145C1"
ActiveChart.SeriesCollection(2).Name = "=Output!R2141C3"
'ActiveChart.SeriesCollection(3).XValues = "=Output!R2142C1:R2145C1"
ActiveChart.SeriesCollection(3).Name = "=Output!R2141C4"
'ActiveChart.SeriesCollection(4).XValues = "=Output!R2142C1:R2145C1"
ActiveChart.SeriesCollection(4).Name = "=Output!R2141C5"
'ActiveChart.SeriesCollection(5).XValues = "=Output!R2142C1:R2145C1"
ActiveChart.SeriesCollection(5).Name = "=Output!R2141C6"
ActiveChart.Location Where:=xlLocationAsObject, Name:="Output"
With ActiveChart
.HasTitle = False
.Axes(xlCategory).HasTitle = False
.Axes(xlSeries).HasTitle = False
.Axes(xlValue).HasTitle = False
End With



The error appears on the line:
'ActiveChart.SeriesCollection(1).XValues = "=Output!R2142C1:R2145C1"

Any idea what's going on and how I can fix this?

Thank you so much!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top