Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting the date from a source file 1

Status
Not open for further replies.

postlethwaited

Technical User
Apr 18, 2006
11
GB
Good Afternoon everyone, I have a database that uses files provided by my clients as the source data - they are either .txt, .csv or .xls. I need to be able to show the date the file was produced next to the data within my database - is there an easy way to extract this information? thanks very much
 
Function myFileDate (strPath As String, strFile As String) As Date
Dim fso As Object
Dim fl As Object
Dim myFileDate As Date
Set fso = CreateObject("Scripting.FileSystemObject")
Set fl = fso.GetFile(strPath & "\" & strFile)
myFileDate = fl.DateLastModified
Set fl = Nothing
Set fso = Nothing
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top