Applies To
Application Object.
Description
Accessor. Returns an object that represents a single built-in dialog (a Dialog object, Syntax 1) or a collection of all built-in dialogs (a Dialogs object, Syntax 2). Read-only.
Syntax 1
object.Dialogs(index)
Syntax 2
object.Dialogs
object
Required. The Application object.
index
Required for Syntax 1. A built-in constant. See the following Remarks section for more information.
Remarks
Using the Dialogs and Show methods, you can display approximately 200 built-in dialog boxes. Each dialog box has a constant assigned to it; these constants all begin with "xlDialog."
For a table of the available constants and their corresponding argument lists, see "Built-In Dialog Box Argument Lists" in online help.
You can also use the Object Browser to browse the list of dialog box constants. On the View menu, click Object Browser. In the Object Browser, select the Microsoft Excel library, and then select the Constants object. Scroll through the list in the Methods/Properties box until you find the constants that begin with "xlDialog." The constants correspond to dialog box names; for example, the constant for the Find File dialog box is xlDialogFindFile.
The Dialogs method may fail if you try to show a dialog box in an incorrect context. For example, to display the Format Data Labels dialog box (using the Visual Basic expression Application.Dialogs(xlDialogDataLabel).Show), the active sheet must be a chart, otherwise the method fails.
See Also
Show Method.
Example
This example displays the dialog box for the Open command on the File menu.
Application.Dialogs(xlDialogOpen).Show