View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default positioning charts

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 Whe=xlLocationAsObject, Name:="Graph"
With myChart.Parent
.Top = Range("C2").Top
.Left = Range("C2").Left
End With

Error:
Run-time error '424'

Object required