Last Modified time...

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

I have an excel spreadsheet that needs to keep track of
the last time another spreadsheet was saved / modified.
Is there a formula that does this?
 
Dennis said:
I have an excel spreadsheet that needs to keep track of
the last time another spreadsheet was saved / modified.
Is there a formula that does this?

Public Function trackFile(strFile As String) As Date
Dim fso, fs, d As Date
Set fso = CreateObject("Scripting.FileSystemObject")
Set fs = fso.GetFile(strFile)
d = fs.DateLastModified
trackFile = d
End Function

Place this function in a Module. Then in your worksheet, enter:
=trackFile("C:\bogus.txt")
 
Back
Top