O

Place the following line in the declaration section of the class module. The available chart events are now viewable (see Figure 20.4): Public WithEvents xlChart As Chart ■ For a review of the various charts events,see "Chart Sheet Events," p. 152,in Chapter 8.

Figure 20.4

The chart events are available after the chart type variable has been declared.

Figure 20.4

The chart events are available after the chart type variable has been declared.

Three events are set up. The primary event, MouseDown, changes the chart scale with a right-click or double-click. Because these actions also have actions associated with them, you need two more events, BeforeRightClick and BeforeDoubleClick, to prevent the usual action from taking place:

0 0

Post a comment