S
SteveBanks
I have a problem trying to programatically create a 3dLine chart, wher
it gives me a '1004' error when trying to set any properties o
SeriesCollection(2).
I can reproduce the error in its simplest form (ignoring my code b
using the macro recorder to record creating the chart, as I get th
error when I play back the recorded macro. It seems to be a proble
manipulating the second (or more) series of this type of chart. If
set the charttype to xlLineStacked for example, it works fine.
I have attached a crude example in chartdemo.xls, which contains
sub's, one that works with a LineStacked chart and one that fails wit
a 3dLine chart, or the relevant code is pasted below.
I have to get a series from a number of sheets, rather than having th
data all on one sheet and charting it with a large 'setsourcedata
range, which I guess is the fallback plan...
Does anyone have any ideas, or am I cracking up?
Thanks
Steve
Charts.Add
ActiveChart.ChartType = xl3dline
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:B13")
PlotBy _
:=xlColumns
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Values = "=Sheet2!R2C2:R13C2"
ActiveChart.SeriesCollection(2).Name = "=Sheet2!R1C2"
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1
+----------------------------------------------------------------
| Attachment filename: chartdemo.xls
|Download attachment: http://www.excelforum.com/attachment.php?postid=356339
+----------------------------------------------------------------
it gives me a '1004' error when trying to set any properties o
SeriesCollection(2).
I can reproduce the error in its simplest form (ignoring my code b
using the macro recorder to record creating the chart, as I get th
error when I play back the recorded macro. It seems to be a proble
manipulating the second (or more) series of this type of chart. If
set the charttype to xlLineStacked for example, it works fine.
I have attached a crude example in chartdemo.xls, which contains
sub's, one that works with a LineStacked chart and one that fails wit
a 3dLine chart, or the relevant code is pasted below.
I have to get a series from a number of sheets, rather than having th
data all on one sheet and charting it with a large 'setsourcedata
range, which I guess is the fallback plan...
Does anyone have any ideas, or am I cracking up?
Thanks
Steve
Charts.Add
ActiveChart.ChartType = xl3dline
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:B13")
PlotBy _
:=xlColumns
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Values = "=Sheet2!R2C2:R13C2"
ActiveChart.SeriesCollection(2).Name = "=Sheet2!R1C2"
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1
+----------------------------------------------------------------
| Attachment filename: chartdemo.xls
|Download attachment: http://www.excelforum.com/attachment.php?postid=356339
+----------------------------------------------------------------