View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_5_] GS[_5_] is offline
external usenet poster
 
Posts: 226
Default Let a user choose a folder?

Robert Crandal presented the following explanation :
I'm using Excel 2007 with VBA. Does Excel and/or VBA
have any custom dialog boxes that allow a user to select
a folder and/or folder path?? I dont want the user to
type in a folder path, so I'm looking for an easy way to
let a user select a folder with a built-in dialog box or
form or something.

Please give me any suggestions. Thank you!

Robert


This will display the dialog to allow user to choose a folder. It
returns the full path.

With Application.FileDialog(4) 'msoFileDialogFolderPicker
If .Show = False Then Exit Function 'User cancelled
sPath = .SelectedItems(1)
End With

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc