hides the legend when it is double-clicked; double-clicking either axis brings back the legend:
Private Sub MyChartClass_BeforeDoubleClick(ByVal ElementID As Long,ByVal Arg1 As Long, ByVal Arg2 As Long, Cancel As Boolean)
Select Case ElementID
Case xlLegend
Me.HasLegend = False
Cancel = True
Case xlAxis
Me.HasLegend = True
Cancel = True
End Select
End Sub
Related examples in the same category