Function to import the most recent file (1 Viewer)

cheezfri

New member
Local time
Today, 14:35
Joined
Sep 12, 2011
Messages
5
Hi guys, I know very little about VBA; I have just put together some code bits based mostly on what I see in this forum :)

There is a manual process I'd like to automate. Instead of the user manually importing an external file into a table, I want a function to grab the most recent file in a particular directory. Is that possible?

For example, I have a table called Input, and I want to append the file I just saved on my network, which in this case is G:\Files\2014\TA_140928_011007.txt. The two ways to know which file to use is that the date is part of the filename (TA_YYMMDD_999999.txt), and also the Date Modified attribute.

I am aware that if the user needs to work the files out of date order, he/she cannot use this code.

Thanks in advance!
cheezfri
 

llkhoutx

Registered User.
Local time
Today, 14:35
Joined
Feb 26, 2001
Messages
4,018
Take a look at "file scripting." What you want can be done.
 

Users who are viewing this thread

Top Bottom