M
mike
I am trying to create a number of charts using VBA, but positioning the
charts is giving me trouble. Thanks in advance for any help.
My code:
Set myChart = Charts.Add
ActiveChart.ChartType = xlXYScatterLines
ActiveChart.SetSourceData Source:=Sheets("Graph").Range(GraphRange),
PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="Graph"
With myChart.Parent
.Top = Range("C2").Top
.Left = Range("C2").Left
End With
Error:
Run-time error '424'
Object required
charts is giving me trouble. Thanks in advance for any help.
My code:
Set myChart = Charts.Add
ActiveChart.ChartType = xlXYScatterLines
ActiveChart.SetSourceData Source:=Sheets("Graph").Range(GraphRange),
PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="Graph"
With myChart.Parent
.Top = Range("C2").Top
.Left = Range("C2").Left
End With
Error:
Run-time error '424'
Object required