Dialog.Show Method (Excel)

Displays the built-in dialog box, waits for the user to input data and returns a Boolean value that represents the user's response.

Syntax

expression .Show(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11, Arg12, Arg13, Arg14, Arg15, Arg16, Arg17, Arg18, Arg19, Arg20, Arg21, Arg22, Arg23, Arg24, Arg25, Arg26, Arg27, Arg28, Arg29, Arg30)

expression A variable that represents a Dialog object.

Parameters

Name

Required/Optional

Data Type

Description

Arg1-Arg30

Optional

Variant

For built-in dialog boxes only, the initial arguments for the command. For more information, see the "Remarks" section.

Return Value

A Boolean value that, for built-in dialog boxes, returns True if the user clicks OK, or it returns False if the user clicks Cancel.

Remarks

For built in dialog boxes, this method returns True if the user clicks OK, or it returns False if the user clicks Cancel.

You can use a single dialog box to change many properties at the same time. For example, you can use the Format Cells dialog box to change all the properties of the Font object.

For some built-in dialog boxes (the Open dialog box, for example), you can set initial values using arg1, arg2, ..., arg30. To find the arguments to set, locate the corresponding dialog box constant in Built-In Dialog Box Argument Lists. For example, search for the xlDialogOpen constant to find the arguments for the Open dialog box. For more information about built-in dialog boxes, see the Dialogs collection.

Example

This example displays the Open dialog box.

Application.Dialogs(xlDialogOpen).Show

See Also

Concepts

Dialog Object Members

Dialog Object