14.3. Linking a Dialog Box to a Procedure

Designing a custom dialog box is only the first step in getting it to work in a procedure. The other step is writing the code to display the dialog box to the user and make it perform its tasks.

Typically, the code for a dialog box consists of the following:

  • A procedure that displays the dialog box by loading it and using the Show method. Usually, this procedure can be assigned to a Quick Access Toolbar button, or to a shortcut key combination so that the user can invoke it. However, a procedure can also run automatically in response to a system event (such as running at a specified time).

  • The user form that contains the dialog box and its controls.

  • The code attached to the user form. This code consists ...

Get Mastering VBA for Microsoft Office 2007, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.