ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Common Dialog Boxes (https://www.excelbanter.com/excel-programming/360958-common-dialog-boxes.html)

Lionel

Common Dialog Boxes
 
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

Jim Rech

Common Dialog Boxes
 
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/DLCou...eForFolder.zip

--
Jim
"lionel" wrote in message
...
|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




All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com