Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This site will provide you with a the Browse Folder dialog box, which will
return the name of the selected folder: http://www.vbaexpress.com/kb/getarticle.php?kb_id=246 -- Kevin Backmann "Ayo" wrote: I am trying to use Application.FileDialog(msoFileDialogFolderPicker) to get a folder and run a macro on each file in that folder. I was using this approach befo folderspec = Application.InputBox(prompt:="Input Folder Path", Title:="Get Folder", Type:=2) but it requires someone to copy and paste the folder path. But I want to use a different approach where the filedialog opens and you can pick the folder directly. I know Application.FileDialog(msoFileDialogFolderPicker) is what is needed but I can figure out what next. This is what I have, and it's giving me an error folderspec = Application.FileDialog(msoFileDialogFolderPicker) Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.getFolder(folderspec) Set fc = f.Files For Each f1 In fc s = f1.Path Workbooks.Open Filename:=s, UpdateLinks:=0 Thanks for the help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Takes too long for Filedialog to change directory | Excel Discussion (Misc queries) | |||
Application | Charts and Charting in Excel | |||
Application | Excel Discussion (Misc queries) | |||
FileDialog to select file | Excel Discussion (Misc queries) | |||
filedialog | Excel Worksheet Functions |