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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top