iuston
Mechanical
- Jan 26, 2005
- 12
I was wondering if exist a method similar to GetOpenFilename that works for folder instead than for file
I would like to select a specific folder every time I run the code, in a similar way as I select a file with the GetOpenFilename (not opening the file, just retaining the path), instead than input the path within the VB code, that means every time i want to change the folder I have to write the code.
For example, in the code below:
fn = "C:\Foldername\"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(fn)
Set fc = f.Files
etc. etc. etc
instead of having fn assigned by the code, i would like to select the path time by time selecting the folder from the window explorer.
Is this possible?
Should be, but I couldn't find the command !
Thanks
I would like to select a specific folder every time I run the code, in a similar way as I select a file with the GetOpenFilename (not opening the file, just retaining the path), instead than input the path within the VB code, that means every time i want to change the folder I have to write the code.
For example, in the code below:
fn = "C:\Foldername\"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(fn)
Set fc = f.Files
etc. etc. etc
instead of having fn assigned by the code, i would like to select the path time by time selecting the folder from the window explorer.
Is this possible?
Should be, but I couldn't find the command !
Thanks