Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompting for a Directory Name
Excel 2003. I currently use "Application.GetOpenFilename" to prompt users to
browse to and select a file. It returns the full file name with path. Is there a similar method by which I can prompt the user to select (browse to) a folder (NOT a file) and have that folder's name and full path returned? Thanks for any help. -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompting for a Directory Name
Jim Rech has a BrowseForFolder routine at:
http://www.oaltd.co.uk/MVP/Default.htm (look for BrowseForFolder) John Walkenbach has one at: http://j-walk.com/ss/excel/tips/tip29.htm If you and all your users are running xl2002+, take a look at VBA's help for: application.filedialog(msoFileDialogFolderPicker) Chaplain Doug wrote: Excel 2003. I currently use "Application.GetOpenFilename" to prompt users to browse to and select a file. It returns the full file name with path. Is there a similar method by which I can prompt the user to select (browse to) a folder (NOT a file) and have that folder's name and full path returned? Thanks for any help. -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompting for a Directory Name
Private Sub CommandButton1_Click() Dim lngCount As Long ' Open the file dialog With Application.FileDialog(msoFileDialogFolderPicker) .AllowMultiSelect = True .Show ' Display paths of each file selected For lngCount = 1 To .SelectedItems.Count MsgBox .SelectedItems(lngCount) Next lngCount End With End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Prompting for a Directory Name
According to the help on AllowMultiselect, it is ignored for picking folders.
Has your experience been different? -- Regards, Tom Ogilvy "stevebriz" wrote: Private Sub CommandButton1_Click() Dim lngCount As Long ' Open the file dialog With Application.FileDialog(msoFileDialogFolderPicker) .AllowMultiSelect = True .Show ' Display paths of each file selected For lngCount = 1 To .SelectedItems.Count MsgBox .SelectedItems(lngCount) Next lngCount End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
prompting while typing | Excel Worksheet Functions | |||
Microsoft Prompting | Excel Discussion (Misc queries) | |||
open in old directory save in new directory | Excel Programming | |||
Creating a macro that lists directory names within a directory.... | Excel Programming | |||
Check if directory empty OR no of files in directory. | Excel Programming |