Muokkaa

Jaa


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
Arg1Arg30 Optional Variant For built-in dialog boxes only, the initial arguments for the command.

Return value

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

Remarks

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 by 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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.