Microsoft Office Tutorials and References
In Depth Information
Understanding Chart Events
Figure 18-14: This chart serves as a clickable image map.
In addition, each of the other worksheets contains a button that executes the ReturnToMain
macro that reactivates the Main sheet.
The complete listing of Module1 follows:
Dim SummaryChart As New EmbChartClass
Sub CheckBox1_Click()
If Worksheets(“Main”).CheckBoxes(“Check Box 1”) = xlOn Then
‘Enable chart events
Set SummaryChart.myChartClass = _
‘Disable chart events
Set SummaryChart.myChartClass = Nothing
End If
End Sub
Sub ReturnToMain()
‘ Called by worksheet button
End Sub
The first instruction declares a new object variable SummaryChart to be of type EmbChart
Class — which, as you recall, is the name of the class module. When the user clicks the Enable
Chart Events button, the embedded chart is assigned to the SummaryChart object, which, in
effect, enables the events for the chart. The contents of the class module for EmbChartClass
Search JabSto ::

Custom Search