getting filenames from a user selected folder

G

Guest

I need to have the user select a folder using msoFileDialogFolderPicker then
get the count and file names of all files in the folder. Please help!
 
T

Tushar Mehta

Help with what? If you know you have to use msoFileDialogFolderPicker
you have to know the context in which it makes sense. So, where are
you stuck?

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
G

Guest

I found a way to accomplish this...

With Application.FileDialog(msoFileDialogFolderPicker)
.AllowMultiSelect = False
.Show
THEpath = .SelectedItems(1)
End With
With Application.FileSearch
.LookIn = THEpath
.FileType = msoFileTypeExcelWorkbooks
.Execute
ALLcount = .FoundFiles.Count
For i = 0 To ALLcount - 1
ALLpaths(i) = .FoundFiles(i + 1)
Next i
End With
 

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