Example The Initialize Event Procedure

Private Sub UserForm Initialize()

' oChart is set to refer to the active chart ' cSeries has count of series

Dim ds As Series

' Fill the lstSeries

For Each ds In oChart.SeriesCollection lstSeries.AddItem ds.Name Next optCopy.Value = True chkOption.Caption = "Copy Formatting" chkOption.Accelerator = "F" cmdUndo.Enabled = False End Sub

We want the caption (and accelerator key) of the check box at the bottom of the dialog to change based on the choice of option button (Link or Copy). Hence, we need some code in the appropriate Click events, as shown in Example 21-13.

0 0

Post a comment