Reputation: 3
I have the below VBA code to return the last saved time stamp in a cell.
The formula only works when I enter the formula bar and click enter. I want the formula to automatically update upon saving.
Function LastSavedTimeStamp() As Date
LastSavedTimeStamp = ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
End Function
Upvotes: 0
Views: 507
Reputation: 152515
Make the UDF Volatile:
Function LastSavedTimeStamp() As Date
Application.Volatile
LastSavedTimeStamp = ThisWorkbook.BuiltinDocumentProperties("Last Save Time")
End Function
Then in the ThisWorkbook
Module add:
Private Sub Workbook_AfterSave(ByVal Success As Boolean)
Application.Calculate
End Sub
Upvotes: 3