Getting a list of files in a folder

  • Thread starter Thread starter Tom Ross
  • Start date Start date
T

Tom Ross

I have a form that looks takes calculations from my database and inserts
them into spreadsheets in a folder.

Currently I have a table with a list of filenames. I loop through the
filenames and update the spreadsheets.

I would like to lread the list of files in a windows folder and load it into
a table, array, or text string that I can loop through

Thanks

Tom
 
I have a form that looks takes calculations from my database and inserts
them into spreadsheets in a folder.

Currently I have a table with a list of filenames. I loop through the
filenames and update the spreadsheets.

I would like to lread the list of files in a windows folder and load it into
a table, array, or text string that I can loop through
dim tmp as string, tmp1 as string
dim ary() as string
tmp=dir("C:\mydirectory\*.xls)
while tmp<>""
tmp1=tmp1 &"|" &tmp
tmp=dir()
wend
ary=split(mid(tmp1,2),"|")

in ary() you have all xls from the directory MyDirectory
 
Thanks Andi

The split function didn't work right away but I didn't really need to load
them in an array just process the filenames as they are created

Tom
 

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

Back
Top