MatthewBell
Technical User
Hello, stuck again!
Thanks xlbo for your code to take me to a charts source data.
The problem now is that I have lots of embedded charts in the same worksheet and can only enable events for 1 at a time.
I execute the following code before anything happens to enable events on ChartObject(2) but I'd like all the charts to execute the same event-handler procedure following selection.
Dim MyChart As New EventsEnabler
Sub EnableChartEvents()
Range("A1"
.Select
Set MyChart.myChartClass = Sheets("Metrics"
.ChartObjects(2).Chart
End Sub
I then store the event-handler procedure in a Class Module named EventsEnabler as follows:
Public WithEvents myChartClass As Chart
Private Sub myChartClass_Select(ByVal ElementID As Long, ByVal Arg1 As Long, ByVal Arg2 As Long)
Blah Blah Blah
End Sub
This works just fine and dandy for ChartObject(2) or whatever individual ChartObject I specify but, as I mentioned above, I'd like to find a way to apply the same event handler procedure to all the chartobjects embedded in a single worksheet.
Is this possible? Any Takers?
Many thanks for your time.
Matt
Thanks xlbo for your code to take me to a charts source data.
The problem now is that I have lots of embedded charts in the same worksheet and can only enable events for 1 at a time.
I execute the following code before anything happens to enable events on ChartObject(2) but I'd like all the charts to execute the same event-handler procedure following selection.
Dim MyChart As New EventsEnabler
Sub EnableChartEvents()
Range("A1"
Set MyChart.myChartClass = Sheets("Metrics"
End Sub
I then store the event-handler procedure in a Class Module named EventsEnabler as follows:
Public WithEvents myChartClass As Chart
Private Sub myChartClass_Select(ByVal ElementID As Long, ByVal Arg1 As Long, ByVal Arg2 As Long)
Blah Blah Blah
End Sub
This works just fine and dandy for ChartObject(2) or whatever individual ChartObject I specify but, as I mentioned above, I'd like to find a way to apply the same event handler procedure to all the chartobjects embedded in a single worksheet.
Is this possible? Any Takers?
Many thanks for your time.
Matt