OPEN.DIALOG macro

Displays the standard Microsoft Excel File Open dialog box with the specified file filters. When the user presses the button specified by button_text, the filename the user picks or types in will be returned.

Syntax

OPEN.DIALOG(file_filter, button_text, title, filter_index)

File_filter    is the file filtering criteria to use, as text. For Microsoft Excel for Windows, file_filter consists of two parts, a descriptive phrase denoting the file type followed by a comma and then the MS-DOS wildcard file filter specification, as in "Text Files (*.TXT), *.TXT, Add-in Files (*.XLA), *.XLA". Groups of filter specifications are also separated by commas. Each separate pair is listed in the file type drop-down list box. File_filter can include an asterisk (*) to represent any sequence of characters and a question mark (?) to represent any single character. For Microsoft Excel for the Macintosh, file_filter consists of file type codes separated by commas, as in "TEXT,XLA ,XLS4". Spaces are significant and should not be inserted before or after the comma separators unless they are part of the file type code.

Button_text    is the text used for the Open button in the dialog. If omitted, "Open" will be used. Button_text is ignored on Microsoft Excel for Windows.

Title    specifies the dialog window title. If omitted, "File Open" will be used as the default.

Filter_index    specifies the index number of the default file filtering criteria from 1 to the number of filters specified in file_filter. If omitted or greater than the number of filters present, 1 will be used as the starting index number. The argument is ignored on Microsoft Excel for the Macintosh.

Remarks

Examples

OPEN.DIALOG("Text Files (*.TXT), *.TXT, Add-in Files (*.XLA), *.XLA,ALL FILES (*.*), *.*","FILE OPENER") opens a file open dialog box titled "FILE OPENER" with three file filter criteria in the drop-down list box.

Related Function

SAVE.DIALOG   Displays the standard Microsoft Excel File Save As dialog box and gets a file name from the user

Return to index