Remarks

The Dialog object is a member of the collection. The Dialogs collection contains all the built-in dialog boxes in Microsoft Excel. You cannot create a new built-in dialog box or add one to the collection. The only useful thing you can do with a Dialog object is use it with the method to display the corresponding dialog box.

The Microsoft Excel Visual Basic object library includes built-in constants for many of the built-in dialog boxes. Each constant is formed from the prefix "xlDialog" followed by the name of the dialog box. For example, the Apply Names dialog box constant is xlDialogApplyNames, and the Find File dialog box constant is xlDialogFindFile. These constants are members of the enumerated type.

Example

Use (), where is a built-in constant identifying the dialog box, to return a single Dialogobject. The following example runs the built-in Opendialog box (Filemenu). The Showmethod returns Trueif Microsoft Excel successfully opens a file; it returns Falseif the user cancels the dialog box.

Visual Basic for Applications
dlgAnswer = Application.Dialogs(xlDialogOpen).Show
dialog dialog object

See also:

index index