i do want adress a chartobject out of a chartarea. let s say i have three chartobjects on the chartarea, so
gives me the three names of the chartobjects, so this is:
chart 1
chart 7
chart 8
What i am looking for is a method/vba code, to get the name of the chartobject of my selection (i select a chartobject in excel with cursor).
what i found is this:
assuming i selected chartobject 2, so chart 7, this actually returns a string, which is a bit difficult: since i use german language settings, it returns me something like: sheetname Diagramm 7 (diagramm is german word for chart).
this made my skeptic!
i now did this:
still selected chartobject 2,
returns still sheetname Diagramm 7 (instead of sheetname hello).
anyone knows why this is? or: anyone knows a solution, how to get the name of the chartobject with Selection using vba?
thank s for any comment!
Code:
activesheet.chartobjects(1).name
activesheet.chartobjects(2).name
activesheet.chartobjects(3).name
gives me the three names of the chartobjects, so this is:
chart 1
chart 7
chart 8
What i am looking for is a method/vba code, to get the name of the chartobject of my selection (i select a chartobject in excel with cursor).
what i found is this:
Code:
selection.parent.name
assuming i selected chartobject 2, so chart 7, this actually returns a string, which is a bit difficult: since i use german language settings, it returns me something like: sheetname Diagramm 7 (diagramm is german word for chart).
this made my skeptic!
i now did this:
Code:
activesheet.chartobjects(2).name = "hello"
still selected chartobject 2,
Code:
selection.parent.name
returns still sheetname Diagramm 7 (instead of sheetname hello).
anyone knows why this is? or: anyone knows a solution, how to get the name of the chartobject with Selection using vba?
thank s for any comment!