How to choose files and folders in VBA
Part one of a three-part series of blogs

To make it easier for users of your VBA systems to choose files, you can show FileDialogs on screen. This blog explains what these are, and how to customise them.

  1. Using File and Folder Dialog Boxes in VBA (this blog)
  2. File and Folder Dialog Boxes
  3. FileDialogs for Selecting Multiple Files

This blog is part of a complete Excel VBA tutorial.  Have a look also at our VBA training courses.

Posted by Andy Brown on 13 January 2012 | 1 comment

You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Using File and Folder Dialog Boxes in VBA

Often in VBA you need to ask someone to choose a file or folder, using a dialog box like this one:

Dialog box for choosing file

Many parts of this dialog box have been customised

This blog explains how to display a dialog box like this, how to customise it and - most importantly - how to get at the file or files selected.


This blog has 1 comment

Comment added on 24 October 2012 at 17:50 GMT
The article was very easy to follow and expand on. I was trying to add a button to an Excel spreadsheet to return the path of a file from which I could then link to from my spreadsheet to reduce redundant data entry.

Your blog was a big help over here on the other side of the pond in Texas.

Thank you.

A full-blown discussion forum is being built for this site, which will allow you once more to add comments and discussion threads.