3
3PhaseMacroMan
Hi all,
Essentially I have an existing worksheet with data and would like t
create charts from that data and place the charts on this sheet. Whe
attempting to run my code, I get an "Automation Error". Here is a
excerpt of my code that is currently problematic:
If Location1_1 > 0 Then
Set case9 = wb.Charts.Add
With case9
.ChartType = xlXYScatterSmooth
.Location Where:=xlLocationAsObject, Name:="DataSet 1"
.SeriesCollection.NewSeries
Set Cycles = SetRange(page1, 3, 62, 8)
.SeriesCollection(1).Xvalues = Cycles
.SeriesCollection(2).Xvalues = Cycles
Set YValues = SetRange(page1, 3, 62, 9)
.SeriesCollection(1).Name = "V1"
.SeriesCollection(1).Values = YValues
.SeriesCollection.NewSeries
.SeriesCollection(2).Name = "I1"
Set YValues = SetRange(page1, 3, 62, 10)
.SeriesCollection(2).Values = YValues
.SeriesCollection(2).AxisGroup = 2
<formatting statements>
End With
End If
End Sub
The compiler highlights the line ".SeriesCollection.NewSeries" as th
source of the error.
Any help would be greatly appreciated.
Thanks
Essentially I have an existing worksheet with data and would like t
create charts from that data and place the charts on this sheet. Whe
attempting to run my code, I get an "Automation Error". Here is a
excerpt of my code that is currently problematic:
If Location1_1 > 0 Then
Set case9 = wb.Charts.Add
With case9
.ChartType = xlXYScatterSmooth
.Location Where:=xlLocationAsObject, Name:="DataSet 1"
.SeriesCollection.NewSeries
Set Cycles = SetRange(page1, 3, 62, 8)
.SeriesCollection(1).Xvalues = Cycles
.SeriesCollection(2).Xvalues = Cycles
Set YValues = SetRange(page1, 3, 62, 9)
.SeriesCollection(1).Name = "V1"
.SeriesCollection(1).Values = YValues
.SeriesCollection.NewSeries
.SeriesCollection(2).Name = "I1"
Set YValues = SetRange(page1, 3, 62, 10)
.SeriesCollection(2).Values = YValues
.SeriesCollection(2).AxisGroup = 2
<formatting statements>
End With
End If
End Sub
The compiler highlights the line ".SeriesCollection.NewSeries" as th
source of the error.
Any help would be greatly appreciated.
Thanks