ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Inserting the date that an excel sheet is saved into a cell (https://www.excelbanter.com/excel-discussion-misc-queries/3200-inserting-date-excel-sheet-saved-into-cell.html)

sharock

Inserting the date that an excel sheet is saved into a cell
 
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.

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)


"sharock" wrote in message
...
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.




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

"sharock" wrote:

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.



All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com