Common Dialog Boxes

G

Guest

I need to allow the user of my program to choose a Folder to work in.
I know how to use the common dialog box procedure using
"Application.Dialogs(commondialogFindFiles)" to allow the user to find a file.
How can I show a common dialog box to pick a folder, instead of a file?
 
J

Jim Rech

You could use the built-in File dialog picker:

Sub a()
Dim x As FileDialog
Set x = Application.FileDialog(msoFileDialogFolderPicker)
x.Show
MsgBox x.SelectedItems(1)
End Sub

or the Windows API folder browser:

http://www.j-walk.com/ss/excel/tips/tip29.htm

http://www.oaltd.co.uk/DLCount/DLCount.asp?file=BrowseForFolder.zip

--
Jim
|I need to allow the user of my program to choose a Folder to work in.
| I know how to use the common dialog box procedure using
| "Application.Dialogs(commondialogFindFiles)" to allow the user to find a
file.
| How can I show a common dialog box to pick a folder, instead of a file?
| --
| Lionel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top