Testing the dialog box

The next step is to try out the procedure that displays the dialog box.

Note When you click the CommandButton on the worksheet, you'll find that nothing happens. Rather, the button is selected. That's because Excel is still in design mode - which happens automatically when you insert an ActiveX control. To exit design mode, click the Developer

Controls Design Mode button. To make any changes to your CommandButton, you'll need to put Excel back into design mode.

When you exit design mode, clicking the button will display the UserForm (see Figure 13-11).

Hn T Wfi-rv 3 "uirtfl

ID Prmf 11 1 nudif L3 D




IW |



Figure 13-11: The CommandButton's Click event procedure displays the UserForm.

When the dialog box is displayed, enter some text into the text box and click OK. Nothing happens - which is understandable considering you haven't yet created any event handler procedures for the UserForm.

Note Click the Close button in the UserForm title bar to get rid of the dialog box.

0 0

Post a comment