ShowFileDialog

Prompts the user to select a file to open (OpenFile) or select a location for saving a file (SaveFile).

Overloads

Overload Name Description
OpenFile Prompts the user to select a file to open.
SaveFile Prompts the user to select a location for saving a file.


OpenFile

Prompts the user to select a file to open.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
DialogCaption The caption displayed in the dialog's title bar. By default, the caption is "Open" (OpenFile) and "Save As" (SaveFile).
Filter
The filter string, which determines the choices that appear in the "Files of type" and the "Save as file type" in the Open File and Save As File dialogs, respectively.
For each filtering option, the filter string contains a description of the filter, followed by the vertical bar (|) and the filter pattern. The strings for different filtering options are separated by the vertical bar.
The following is an example of a filter string: "Excel 2007-2010 Workbook (*.xlsx)|*.xlsx|Excel 97-2003 Workbook (*.xls)|*.xls|All files (*.*)|*.*"
You can add several filter patterns to a filter by separating the file types with semi-colons, for example, "Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.*"
FilterIndex The index of the filter automatically selected in the "Files of type" box in the dialog. The index of the first filter is 1, which is the default.
Filename The file name automatically selected in the dialog by default.
InitialDirectory
The initial directory displayed by the file dialog.
The InitialDirectory is typically set to a standard windows system or user path, which can be specified using the @SpecialFolder() function.
RestoreDirectory
Controls whether the dialog restores the current directory before closing. The default value is FALSE.
When TRUE, the dialog restores the current directory to its original value if the user changed the directory while searching for files.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CheckFileExists Controls whether a warning is displayed if the user specifies a file name that does not exist. The default value is TRUE.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CheckPathExists Controls whether a warning is displayed if the user specifies a path that does not exist. The default value is TRUE.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
AddExtension
Controls whether an extension is automatically added to a file name if the user omits the extension. The default value is TRUE.
The extension added to a file name depends on the currently selected file filter and the value of the CheckFileExists argument.
If the CheckFileExists property is TRUE, the first extension from the current file filter that matches an existing file is added as the extension. If no files match the current file filter, the extension specified as the DefaultExtension argument is added.
If the CheckFileExists property is FALSE, the first valid file name extension from the current file filter is added as the extension. If the current file filter contains no valid file name extensions, the extension specified as the DefaultExtension argument is added.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
DefaultExtension The default file name extension.
DialogResultPropertyName The name of the script property that will receive the value of the dialog result, which includes OK and Cancel.
FilenamePropertyName The name of the script property that will receive the value of the selected file name, which includes the path and the extension.

SaveFile

Prompts the user to select a location for saving a file.

Argument Description
SpecifySheetBy Select how to specify which worksheet to select while the method is being executed.
Specify one of the following values or an arbitrary value: <blank>SheetNameSheetNumberAllSheets
SheetSpec Specify the sheet-name or sheet-number, depending on SpecifySheetBy. If SpecifySheetBy is AllSheets then SheetSpec can be left empty.
Address The address of a range to select for the execution of the method.
CellByCell Whether to execute the method on a cell-by-cell basis, or on the range specified by the address.
ReverseOrder Whether to loop through the rows and columns from highest to lowest. Only applies when CellByCell is true.
MethodCondition If the result of method-condition expression resolves to FALSE, then the method is not executed.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CellCondition If the result of the condition expression resolves to FALSE, then the current cell is skipped.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
DialogCaption The caption displayed in the dialog's title bar. By default, the caption is "Open" (OpenFile) and "Save As" (SaveFile).
Filter
The filter string, which determines the choices that appear in the "Files of type" and the "Save as file type" in the Open File and Save As File dialogs, respectively.
For each filtering option, the filter string contains a description of the filter, followed by the vertical bar (|) and the filter pattern. The strings for different filtering options are separated by the vertical bar.
The following is an example of a filter string: "Excel 2007-2010 Workbook (*.xlsx)|*.xlsx|Excel 97-2003 Workbook (*.xls)|*.xls|All files (*.*)|*.*"
You can add several filter patterns to a filter by separating the file types with semi-colons, for example, "Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.*"
FilterIndex The index of the filter automatically selected in the "Files of type" box in the dialog. The index of the first filter is 1, which is the default.
Filename The file name automatically selected in the dialog by default.
InitialDirectory
The initial directory displayed by the file dialog.
The InitialDirectory is typically set to a standard windows system or user path, which can be specified using the @SpecialFolder() function.
RestoreDirectory
Controls whether the dialog restores the current directory before closing. The default value is FALSE.
When TRUE, the dialog restores the current directory to its original value if the user changed the directory while searching for files.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CheckFileExists Controls whether a warning is displayed if the user specifies a file name that does not exist. The default value is TRUE.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
CheckPathExists Controls whether a warning is displayed if the user specifies a path that does not exist. The default value is TRUE.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
AddExtension
Controls whether an extension is automatically added to a file name if the user omits the extension. The default value is TRUE.
The extension added to a file name depends on the currently selected file filter and the value of the CheckFileExists argument.
If the CheckFileExists property is TRUE, the first extension from the current file filter that matches an existing file is added as the extension. If no files match the current file filter, the extension specified as the DefaultExtension argument is added.
If the CheckFileExists property is FALSE, the first valid file name extension from the current file filter is added as the extension. If the current file filter contains no valid file name extensions, the extension specified as the DefaultExtension argument is added.
Specify one of the following values or an arbitrary value: <blank>FALSETRUE
DefaultExtension The default file name extension.
CreatePrompt Controls whether the dialog prompts the user for permission to create a file if the user specifies a file that does not exist. The default value is FALSE.
OverwritePrompt Controls whether the dialog displays a warning if the user specifies a file name that already exists. The default value is TRUE.
DialogResultPropertyName The name of the script property that will receive the value of the dialog result, which includes OK and Cancel.
FilenamePropertyName The name of the script property that will receive the value of the selected file name, which includes the path and the extension.