DialogBox Method

Applies To

Range Object.

Description

Displays a dialog box defined by a dialog-box definition table on a Microsoft Excel version 4.0 macro sheet. Returns the number of the chosen control, or False if the user chooses the Cancel button.

Syntax

object.DialogBox

object

Required. A range on a Microsoft Excel 4.0 macro sheet that contains a dialog-box definition table.

Remarks

This method is included for backward compatibility with the Microsoft Excel version 4.0 macro language.

Example

This example runs a Microsoft Excel version 4.0 dialog box and then displays the return value in a message box. The dialogRange variable refers to the dialog box definition table on the Microsoft Excel version 4.0 macro sheet Macro1.


Set dialogRange = Excel4MacroSheets("Macro1").Range("myDialogBox")
result = dialogRange.DialogBox
MsgBox result