check date on source file

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
 
J

John Nurick

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
 
Top