I need to catch event in Excel VBA when I click on the chart.
I want to bring the chart to the front, when it is activated, but I can\'t find an appropriate event.>
Create a handler in the worksheet:
Public Sub ChartSelected(ByVal Name As String)
Me.ChartObjects(Name).BringToFront
End Sub
Right-click the chart and select Assign macro, then type something like
'Sheet1.ChartSelected "Chart 1"'
where Chart 1
is the name of the chart.
To assign this handler programmatically, use
ChartObject.OnAction = "'Sheet1.ChartSelected ""Chart 1""'"