Display Last Modified Date


Posted by Tara Prosser on October 23, 2000 4:04 PM

How can I make Excel display in a cell the date that the Excel file was last modified?



Posted by Ivan Moala on October 23, 2000 8:26 PM

This UDF may help

Function Filedate_LastMod(Filename As String) As String
Dim FileDate As Double

On Error Resume Next
FileDate = FileDateTime(Filename)
If Err.Number = 0 Then
Filedate_LastMod = Format(FileDate, "dd/mm/yy hh:mm:ss")
Else
Filedate_LastMod = "Error"
End If
End Function


Place in a Module and call from worksheet as
follows

=Filedate_LastMod("D:\Xl_useful\FiledateFunction.xls")


Ivan