Browsing To

To display a folder location and/or file location you can use the ComboBox control.
By changing the "DropButtonStyle" to fmDropButtonStyleEllipsis we can create a control that resembles a filename box.

Add a Userform.
Add a ComboBox to the userform.
Change the Name property to "cboFileName".
Change the DropButtonStyle property to "fmDropButtonStyleEllipsis".
Add a CommandButton to the userform.
Change the Caption property to "Cancel"
Double click on the combobox and add a handler for the "DropButtonClick" event.
This will allow you to browse for a folder or file location when the ellipsis is pressed.


Selecting a File

To select a file can should use the Application.FileDialog - FilePicker method.


Selecting A Folder

To select a folder you should use the Application.FileDialog - FolderPicker method.




Important

One annoying aspect of hooking the DropButtonClick event is that we can't cancel it so the control shows an empty list after we have obtained the filename.
One workaround it to toggle the Enabled property of the control which forces the focus to move to the next control in the tab order.


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext