Manipulating files

pdbowling

Registered User.
Local time
Today, 01:54
Joined
Feb 14, 2003
Messages
179
Good day all.
I have a directory full of files (.xls) that I need to open up and change but I can't be sure what the file names are going to be.

Is there a nice way to use 'File System Objects' to loop through all the files in a folder? Any alternate suggestions would be greatly appreciated also.

Thanks
PB
 
asuming you are allready in the folder:
FileName = Dir("*.xls")
do while filename <> ""'
'do stuf here
filename = dir
loop

Regards

P.S. you might also use GetFile so you can browse to the folder and hand pick the file(s)
 
This thread: Rename Files has an example of using Dir (as namliam suggested) and the Scripting Runtime Object Library. If you can use VBA to get your file list that would be simplest.

For more on the Scripting Runtime Object Library, check out this link: An Introduction to the Scripting Runtime Object Library .
 

Users who are viewing this thread

Back
Top Bottom