check date on source file

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hello,

Is there any way to determine the modified or create date
on a linked, or for that matter any named file on the
hard drive where my app is running?

I've been trying to use
Application.FileSearch.LastModified but it does not
appear to return a date.

Any suggestions or help is greatly appreciated.

Mike
 
Hi Mike,

Something like this air code should do it. See VBSCRIP5.CHM for help on
the FileSystemObject object.

Function FileDateModified(FilePath As String) As Date
Dim fso As Object
Dim foF As Object

Set fso = New Scripting.FileSystemObject
Set foF = fso.GetFile(FilePath)
FileDateModified = foF.DateLastModified
Set foF = Nothing
Set fso = Nothing
End Function
 
Back
Top