Getting Charts Names via vb invoke code

Hi all,

How can i learn what is the name of the chart using v.b net in invoke code?

Thank you.

I cannot edit my post so i’m writing here

EDIT : In Excel how to get chart or charts name using vb code

NOT : Cannot use activity.

Hi @Kuki_Force ,
Create a function that you call from within the sub, that sends the name of the active chart, for example:

Function actchart(ActiveChart As String) As String
  actchart = ActiveChart
End Function

And then from within your sub, you can replace, as an example, where you have:

ActiveSheet.Shapes("Chart 9").Name = "waterfall" 


ActiveSheet.Shapes(actchart(ActiveChart.Parent.Name)).Name = "waterfall"

This is VBA code.

Thanks & Regards,
Shubham Dutta