xlms workbook contains a worksheet named UFormConfig. This worksheet
holds information about each step in the wizard. This is where we can change the order of the
steps or insert a new step. This class will hold that information for us. How will it do that when
it (apparently) only holds information on one step?
Table 4-9 lists the cStep class??™s properties and describes them.
Table 4-9. cStep Properties
Property Description
Order Holds the step??™s place in the wizard process??™s order
Page Holds the page number corresponding to a page in the MultiPage control
Caption The text to display on the currently active Page control
We are now going to design a class to manage the steps in the wizard. In that class, we??™ll
create a collection of cStep objects that we??™ll use to keep track of where we are in the process
and how many steps we have.
Insert a new class module and name it cStepManager. Add the following module-level variable
declarations:
Dim m_oStep As cStep
Dim m_iNumSettings As Integer
Dim m_iNumSteps As Integer
Dim m_iCurrentPage As Integer
Dim m_iPreviousPage As Integer
Dim m_iNextPage As Integer
Dim WithEvents m_oPreviousButton As MSForms.CommandButton
Dim WithEvents m_oNextButton As MSForms.CommandButton
Dim m_oWorksheet As Worksheet
We have a cStep object, m_oStep, that we??™ll be using to populate a collection of steps for
the wizard, followed by a few Integer variables. These tell us how many steps we have and
CHAPTER 4 n USERFORMS 173
how many properties each step has, and they track the current, next, and previous steps based
on where in the wizard the user might be.
Pages:
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182