Microsoft Office Development and Consultancy
|Excel > Charts > VBA Code > Creating||< Previous | Next >|
This will create a new chart on a chart sheet
When you create a chart using the Add method of the Charts collection the chart is created on a chart sheet
When you create a new embedded chart you are adding the chart to the ChartObjects collection for that particular worksheet.
This method returns an Excel.ChartObject
ChartObject.Add(Left, Top, Width, Height)
Left - the number of pointd from the upper left corner of cell A1
Top - the number of points from the ??
Width - The width of the embedded chart
Height - The height of the embedded chart
This will create a new embedded chart on the active worksheet
There is no Charts collection for a worksheet.
You can then use the Location method to move to the chart to an embedded chart on a particular worksheet
The following line of code moves an embedded chart back to a chart sheet
Always work with a Chart Object
Whenever you are working with charts you want to refer to a chart object not a chartobject object.
|© Better Solutions Limited 10-May-2013||< Previous | Top | Next >|