reading text all text files in a folder into excel.
Posted on 2004-11-18
I have an automated process that writes a text file to a folder on our network drive everytime someone accesses a spreadsheet. I need write code to automatically check this folder for files every 5 minutes and if there is a file, to open it and import the data.
How do I check for files in this folder. I want this code to loop until there aren't anymore files in the folder. (Once the file is imported, my code deletes the text file) Things are getting out of control and I'm approaching 2000 text files!!! please help.
So I am asking for the part of the code below in caps:
1.CHECK FOLDER FOR FILES
2.if file present, open file and import data into sheet
3.close and delete file.
4. LOOP BACK TO STEP 1