To create a custom dialog box in Microsoft Excel version 4.0, you use the Dialog Editor to generate a dialog box definition you place on a macro sheet. You then use the DIALOG.BOX macro function to display your dialog box.
In Microsoft Excel version 7.0, custom dialog boxes are stored on dialog sheets in your workbook. To create a custom dialog box, you use the buttons on the Forms toolbar to design and run a dialog box on a dialog sheet in a workbook. You use the Show method in a Visual Basic procedure to display your custom dialog box.
You can use the DialogBox method in your Visual Basic procedures to run a Microsoft Excel 4.0 custom dialog box. The following example uses the DialogBox method to display such a dialog box and then tests the result. The variable DialogRange refers to the range on a Microsoft Excel 4.0 macro sheet that contains the dialog-box definition table.
Result = DialogRange.DialogBox If Not Result Then ' User canceled the dialog box Else ' Result is position number of chosen control End If
For more information about using dialog boxes in programming Microsoft Excel version 7.0, see Chapter 8, "Controls and Dialog Boxes."