Application.FileDialog
Added in Office 2002.
This provides a single object that allows you to display four different types of dialog box.
This includes dialog boxes for opening Files, saving Files, selecting Files and selecting Folders.
This is a much more powerful version of the previous GetOpenFileName and GetSaveAsFileName
One advantage of this FileDialog object is that you can display a list of just directories, rather than both directories and files.
This also has the advantage of being available in all the Office applications.
Types of Dialog Box
There is very little difference between the four types except the caption displayed at the top of the dialog box.
The FilePicker and FolderPicker display the word "Browse" in the caption while the other two display "File Open" and "File Save As".
They all display directories and files except the FolderPicker.
The Office prefix is not required but it makes it clear that it is an object in the Office library.
Displaying the Dialog Box
The Show method will display the dialog box.
This method will not actually open the files but just adds the selection to the SelectedItems collection.
If the user clicks Open then "True" is returned.
If the user clicks Cancel then "False" is returned.
You can use the Execute method to actually open or save the files.
Select Multiple Files
Properties / Methods
| AllowMultiSelect | When true, multiple files can be selected |
| Application | The container application object |
| ButtonName | The string displayed on the action button |
| Creator | Indicates the application which the object was created |
| DialogType | The msoFileDialogType of the dialog |
| FilterIndex | The default file folder |
| Filters | Gets the read-only FileDialogFilters collection |
| InitialFileName | The path or filename that is initially displayed |
| InitialView | The msoFileDialogView for the initial view |
| Item | The text associated with the object |
| Parent | The parent object |
| SelectedItems | The FileDialogSelectedItems collection of the selected items |
| Title | The title text of the dialog window |
| Execute | (method) Carries out the users action, after the Show method is invoked |
| Show | (method) Displays the dialog box and returns a Long indicating which button was pressed |
| AllowMultiSelect When true, multiple files can be selected |
| Application The container application object |
| ButtonName The string displayed on the action button |
| Creator Indicates the application which the object was created |
| DialogType The msoFileDialogType of the dialog |
| FilterIndex The default file folder |
| Filters Gets the read-only FileDialogFilters collection |
| InitialFileName The path or filename that is initially displayed |
| InitialView The msoFileDialogView for the initial view |
| Item The text associated with the object |
| Parent The parent object |
| SelectedItems The FileDialogSelectedItems collection of the selected items |
| Title The title text of the dialog window |
| Execute (method) Carries out the users action, after the Show method is invoked |
| Show (method) Displays the dialog box and returns a Long indicating which button was pressed |
© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext