> The problem is that it still changes the
> appearance of the other points in the series
In what way, do you mean whole series gets selected instead of single point
/ label, or do you want to end up with nothing on the chart selected.
Depending on what you want to do maybe play around with the extra stuff I've
inserted into Vic's code. Try the Deselect line in different places, MouseUp
perhaps.
Sounds like you are working with a chart object on a worksheet, so I assume
you have got your own "Withevents" class.
'with module variables and MouseDown per Vic's original
Private Sub Chart_BeforeDoubleClick(ByVal ElementID As Long, _
ByVal Arg1 As Long, ByVal Arg2 As Long, Cancel As Boolean)
If IDNum = xlSeries Or IDNum = xlDataLabel Then
If Arg2 = -1 Then
On Error Resume Next
If IDNum = xlSeries Then
Selection.Points(b).Select
Else: Selection(b).Select
'or if label selected select point
'Selection.Parent.Points(b).Select
End If
End If
MsgBox "ElementID : " & IDNum & vbLf & _
"SeriesIndex : " & a & vbLf & _
"PointIndex : " & b
Cancel = True
ActiveChart.Deselect
End If
End Sub
Regards,
Peter
"John Coleman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Vic - this is quite nice and almost does what I want. The problem is
> that it still changes the appearance of the other points in the series
> (avoiding that was why I was trying to use before double click rather
> than the select event in the first place) If I place the statement
> Range("H15").select in your code (where H10 is a cell masked by the
> chart) then this still appears as a momentary flash involving the
> other points which no monkeying with screen-updating seems able to
> eliminate. This is really a minor aesthetic issue which I can probably
> live with. If it bugs me too much I might get radical and make each
> point a separate series as my intended application will have less than
> 256 points.
>
> Thanks again for the nice code.
>
> -John Coleman
>
> (E-Mail Removed) (Vic Eldridge) wrote in message
news:<(E-Mail Removed)>...
> > John, I think you'll like this one.
> >
> > Regards,
> > Vic Eldridge
> >
> >
> >
> >
> >
> > Dim IDNum As Long
> > Dim a As Long
> > Dim b As Long
> >
> > Private Sub Chart_MouseDown(ByVal Button As Long, ByVal Shift As Long,
> > ByVal x As Long, ByVal y As Long)
> > ActiveChart.GetChartElement x, y, IDNum, a, b
> > End Sub
> >
> > Private Sub Chart_BeforeDoubleClick(ByVal ElementID As Long, ByVal
> > Arg1 As Long, ByVal Arg2 As Long, Cancel As Boolean)
> > If IDNum = xlSeries Or IDNum = xlDataLabel Then
> > MsgBox "ElementID : " & IDNum & vbLf & _
> > "SeriesIndex : " & a & vbLf & _
> > "PointIndex : " & b
> > Cancel = True
> > End If
> > End Sub
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > (E-Mail Removed) (John Coleman) wrote in message
news:<(E-Mail Removed)>...
> > > Greetings,
> > > I have an embedded chart (XY-scatter) for which I have enabled
> > > events. I want to use BeforeDoubleClick to launch a sub when a series
> > > point is double-clicked with the coordinates of the point as
> > > parameters of the sub. The online help says that the parameter Arg2
> > > should be the point index of the selected point of the selected
> > > series. This is exactly what I want, but BeforeDoubleClick seems to
> > > set Arg2 to -1 the majority of the times. This seems to be when the
> > > entire series rather than a point is selected. Does anyone know of a
> > > way that I can avoid this behavior? When I put the mouse over a point
> > > and double click I would like to be able to reliably capture the point
> > > index.
> > >
> > > A similar problem involves data labels.
> > >
> > > Thank you for your time.
> > >
> > > -John Coleman