How can I read files in a folder...

PISCES

Registered User.
Local time
Today, 08:46
Joined
Mar 11, 2004
Messages
12
using VBA.

I can select a folder from my existing application, using an API. I now need to read the file names in the folder selected.
How can I achieve this?

Kind regards
 
Thanks Namliam

I was just looking into this...

Thanks for your speedy response however!!
 
Can't get Dir to work!!

I've got the following code but y always results in an empty string!!

ChosenFolder is the folder the have selected. There are files in the folder.


If chosenFolder <> "" Then

y = Dir(chosenFolder & "*.*")
Do Until y = ""
Debug.Print y
y = Dir
Loop

Thank you.
 
PISCES said:
I've got the following code but y always results in an empty string!!

ChosenFolder is the folder the have selected. There are files in the folder.


If chosenFolder <> "" Then

y = Dir(chosenFolder & "*.*")
Do Until y = ""
Debug.Print y
y = Dir
Loop

Thank you.

does chosenFolder end with a "\"? If it does not, then it will break.

gcomyn
 

Users who are viewing this thread

Back
Top Bottom