Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

naming charts 1

Status
Not open for further replies.

jluft

Technical User
May 4, 2004
74
US
all,
i am trying to rename a chart/graph...when created, it is being assigned the default name, "Chart 29"...for some reason it is not allowing me to manipulate this value manually or via code...i tried the line

activechart.name = "XYZ" and this is returning an error msg..does anyone have an idea as to how i can resolve this? thanks
 


Hi,

Please post ALL the code up to the point where it errors.

Skip,

[glasses] [red]Be advised:[/red]To be safe on the FOURTH, don't take a FIFTH on the THIRD, or...
You might not come FORTH on the FIFTH! [tongue]
 


BTW, there's a difference in a Chart Object and a ChartObject Object. This may be the problem.

Charts & VBA faq707-4811

Skip,

[glasses] [red]Be advised:[/red]To be safe on the FOURTH, don't take a FIFTH on the THIRD, or...
You might not come FORTH on the FIFTH! [tongue]
 
skip,
actually i was just testing the property by selecting the chart, and then trying to execute the code that i already showed you...
for example,
<select the chart manually>
enter code and run
activechart.name = "XYZ"

i do not understand why this property would be behaving as though it is unalterable..even when i simply click on the chart itself and try to overwrite the name on the top left of the screen, it does not allow for this action to take place. could this be as simple as me havnig a property disable without knowing it?
 


I deduce that you have an embedded chart in a worksheet.

Did you read the FAQ? It might have helped you discover the answer.

Chart Objects have name properties.

Chart properties in ChartObject Objects do NOT have name properties. ChartObject Objects have name properties.

So in YOUR CASE...
Code:
ActiveChart.Parent.Name = "XYZ"


Skip,

[glasses] [red]Be advised:[/red]To be safe on the FOURTH, don't take a FIFTH on the THIRD, or...
You might not come FORTH on the FIFTH! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top