Importing file that name changes (1 Viewer)

Lcrox

New member
Local time
Today, 18:22
Joined
May 11, 2023
Messages
1
Hi All,

I’m really new to VBA so currently finding it all a little over whelming to say the least.
Whilst I have code to import files with a static name, I need to understand the code needed to import files that name changes each time it is received due to date stamp.
E.g yyyymmdd_test_file.csv
What code would be required in order to import the above into access?
Any help/support is greatly received.
 

plog

Banishment Pending
Local time
Today, 12:22
Joined
May 11, 2011
Messages
11,646
How do you know which file you want to import--Is it the newest file by the windows file system date, is it the newest file by the file name or is there a 3rd way? Give this some thought and then test it by thinking of ways your method might get screwed up.

Most likely you would then need to work with a FileSystem object in VBA to access windows directories to search all files to determine whatever your definition of 'newest' is:

 

Users who are viewing this thread

Top Bottom