Inserting the date that an excel sheet is saved into a cell

S

sharock

I need to insert the last saved (last updated) date into my excel sheet. Is
there a way to do this? It can be done in MS Project and MS Word.
 
B

Bob Phillips

You will need a UDF

Function DocProps(prop As String)
application.volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function
and enter



in a cell such as
=DocProps ("last author") for the author
or
=DocProps ("last save time") for the last saved date, format the cell as
date


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
G

Gary Brown

To put the Last saved information into the Active Cell...

Sub test()
Dim objProperty As Object

On Error Resume Next

For Each objProperty In _
ActiveWorkbook.BuiltinDocumentProperties
With objProperty
If .Name = "Last save time" Then
ActiveCell.Value = .Value
End If
End With
Next

End Sub

HTH,
Gary Brown
 
Top