I've got a chart embedded in a spreadsheet that is called 'Chart 1'.
I've got some code to run and set the trendline which seems to run ok.
However, I don't really like having charts called 'Chart 1' as I find it more difficult for other people to decipher the code. If I change the chart object using
it fails on the first line above with RTE '-2147024809 (80070057): This member can only be accessed for a chart object.'
[Note, I also change the 'Chart 1' to 'STP' in the problematic line.]
Is there some other way I ought to rename the chart? Trying directly from excel doesn't work for me (Excel 2010).
I've got some code to run and set the trendline which seems to run ok.
Code:
Dim STPChart As Chart
Set STPChart = Worksheets("Detector1_Report").ChartObjects("Chart 1").Chart
With STPChart
blah blah blah...
However, I don't really like having charts called 'Chart 1' as I find it more difficult for other people to decipher the code. If I change the chart object using
Code:
ActiveChart.Parent.Name = "STP"
[Note, I also change the 'Chart 1' to 'STP' in the problematic line.]
Is there some other way I ought to rename the chart? Trying directly from excel doesn't work for me (Excel 2010).