Dialogs Collection Object

Description

A collection of all the Dialog objects in the Microsoft Excel application. Each Dialog object 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. 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.

Accessors

Use the Dialogs method with an argument to access a single member of the collection or without an argument to access the entire collection at once. 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."

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

Properties

Application Property, Count Property, Creator Property, Parent Property.

Methods

Item Method.