John McGraw
Board Regular
- Joined
- Feb 25, 2002
- Messages
- 76
I am automating chart creation and I am trying to see how I can access the chart as its shape so I can change the size. But unless I hardcode a specific name in the shape() index, I cannot get it to work.
I am now trying the following: (The chart I am working with is active)
ActiveSheet.Shapes(ActiveChart.Name).Left = Sheet1.Cells(3, 2).Left
This ALMOST works, but the ActiveChart.Name property also includes the name of the sheet which is causing a "name not found" error when the above code is run.
I have tried watching the macro-creator but it always hardcodes the name of the chart when accessing the shapes object. (I wonder how IT gets the name! )
What can I do to access the shape of the current chart without hard-coding the actual name into my code?
Thanks very much for any help. This problem is driving me nuts!
John
This message was edited by John McGraw on 2002-04-16 00:19
I am now trying the following: (The chart I am working with is active)
ActiveSheet.Shapes(ActiveChart.Name).Left = Sheet1.Cells(3, 2).Left
This ALMOST works, but the ActiveChart.Name property also includes the name of the sheet which is causing a "name not found" error when the above code is run.
I have tried watching the macro-creator but it always hardcodes the name of the chart when accessing the shapes object. (I wonder how IT gets the name! )
What can I do to access the shape of the current chart without hard-coding the actual name into my code?
Thanks very much for any help. This problem is driving me nuts!
John
This message was edited by John McGraw on 2002-04-16 00:19