Dialog Object

Description

Represents a built-in Microsoft Excel dialog box. The only useful thing you can do with a Dialog object is use it with the Show method to display the dialog box. Do not confuse the Dialog object with the DialogSheet object, which represents a custom dialog sheet, or the DialogFrame object, which represents the boundaries of the custom dialog box on a dialog sheet.

Accessors

The Dialog object is a member of the Dialogs collection. The Dialogs collection contains all Microsoft Excel built-in dialog boxes. You cannot create a new built-in dialog box or add one to the collection.

To access a single member of the collection, use the Dialogs method with an argument. The following example runs the built-in File Open dialog box. The Show method returns True if Microsoft Excel successfully opens a file, or False if the user cancels the dialog box.


dlgAnswer = Application.Dialogs(xlDialogOpen).Show

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. To see a list of the available constants using the Object Browser, select the Constants module in the Excel library, and scroll down the Methods/Properties list until you see the constants beginning with "xlDialog."

Properties

Application Property, Creator Property, Parent Property.

Methods

Show Method.