Assign name to chart object?

R

robotman

Is it possible to assign a name to a chart?

Here's how I create the chart (the code makes the chart to fit in a
designated range of cells):


ActiveSheet.ChartObjects.Add(ChartLocation.Left,
ChartLocation.Top, ChartLocation.Width, ChartLocation.Height).Select
ActiveChart.SeriesCollection.Add Source:=ChartXValues

When I look at the ActiveChart.Name property, it is the Worksheet name
+ " Chart 1" (ex. "MyWorksheet Chart 1"). I can't figure out how to
assign a new name to the chart. Is the .name propery read-only for
charts?

Thanks.
 
P

Peter T

Name the ChartObject, not the ChartObject.Chart.

Activechart.Parent.name = "myChart" ' if a worksheet chart
Activechart.Chartobjects(1).Name = "myChart"

manually - hold Ctrl and select the chart, type a name in the box left of
input-bar

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top