General discussion
December 22, 2002 at 10:52 PM
chouf

XL97 – Add the “last edited” time in a c

by chouf . Updated 23 years, 7 months ago

A user wants that in a specific cell in a XL97 workbook, the date and time when the spreadsheet was saved for the last time appears automatically when the file is open.
I found some posts around and I now have the following VBA code. One problem persists, somtimes it works and somtimes not and I can’t find why. Could you guys test this code and let me know if it works … ? Don’t forget to format cell A2 as dat & time. Personaly I had to choose custom > dd/mm/yyyy hh:mm:ss

Private Sub auto_open()
If ActiveWorkbook.Saved = True Then
Worksheets(1).Range(“A2”).Value = ActiveWorkbook.BuiltinDocumentProperties(“Last Save Time”)
End If
End Sub

This discussion is locked

All Comments