View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
witek witek is offline
external usenet poster
 
Posts: 12
Default positioning charts


With ActiveChart.Parent
.Top = Range("C2").Top
.Left = Range("C2").Left
End With


mychart doesn't represent chart after changing location and only
Microsoft knows why.



mike wrote:
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