I want to return which data point is select on an embedded chart. My code almost works. The message box returns the series selected (ARG1) but the point (ARG2) returns -1 on the first click then the datapoint selected on a second click after the data series has been selected by the first click.
Somehow I need to select the data series then the datapoint.
I've tried a mousedown and a mouseup but they haven't worked and do't return ARG1 and ARG2 anyway.
Any ideas?
ziggy
This is in the module
Dim myClassModule As New EventClassModule
Sub InitializeChart()
Set myClassModule.myChartClass = _
Worksheets(1).ChartObjects(1).Chart
End Sub
This is in the class module
Public WithEvents myChartClass As Chart
Private Sub myChartClass_Select(ByVal ElementID As Long, ByVal Arg1 As Long, ByVal Arg2 As Long)
ActiveChart.SeriesCollection(1).Select
MsgBox (Arg1 & Chr(10) & Arg2)
End Sub
Somehow I need to select the data series then the datapoint.
I've tried a mousedown and a mouseup but they haven't worked and do't return ARG1 and ARG2 anyway.
Any ideas?
ziggy
This is in the module
Dim myClassModule As New EventClassModule
Sub InitializeChart()
Set myClassModule.myChartClass = _
Worksheets(1).ChartObjects(1).Chart
End Sub
This is in the class module
Public WithEvents myChartClass As Chart
Private Sub myChartClass_Select(ByVal ElementID As Long, ByVal Arg1 As Long, ByVal Arg2 As Long)
ActiveChart.SeriesCollection(1).Select
MsgBox (Arg1 & Chr(10) & Arg2)
End Sub