How do I check the excel file modified date before import it? (1 Viewer)

D

debora

Guest
I would like to create a routine to import excel files into a table. My question is, how do I check for the excel file date before I import it. I mean, in my routine I would like to import the excel file just if the excel file modified date is equal to "today" if not display a error message. Hint, I am not an advanced programmer just an user ... thanks
 

Rickster57

Registered User.
Local time
Yesterday, 21:47
Joined
Nov 7, 2005
Messages
431
Excel

You could create a spreadsheet in your Excel Workbook that uses a filter such that the modified date is only =Date. That way only the data you are interested in comes into Access.

Then use the DoCmd.TransferSpreadsheet in Access to import that filtered page.
 

david.brent

Registered User.
Local time
Today, 05:47
Joined
Aug 25, 2004
Messages
57
Hello,

Code:
modDate= FileDateTime([I]Your Filename inc path[/I])

This should do the trick.

Take care.
 

Users who are viewing this thread

Top Bottom