ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Date last update for the file (https://www.excelbanter.com/excel-discussion-misc-queries/42226-date-last-update-file.html)

Chetoos

Date last update for the file
 
Dear experts;

Would you please i wanat to insert the date in a cell , but that
date i wanat it last update for the file ; i mean when the file changed
(updated with new info); i want the cell changed outomatically with last date
of updates; other wise the cell snad still as it be;

Many thanks for your time ;

Bob Phillips


'-----------------------------------------------------------------
Function DocProps(prop As String)
'-----------------------------------------------------------------
Application.Volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocument*Properties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function


and enter in a cell such as
=DocProps ("last save time")


This will not update when you save within Excel. If you need this, add

Option Explicit

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Application.EnableEvents = False
Cancel = True
ActiveWorkbook.Save
Application.CalculateFull
wb_exit:
Application.EnableEvents = True
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--

HTH

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


"Chetoos" wrote in message
...
Dear experts;

Would you please i wanat to insert the date in a cell , but

that
date i wanat it last update for the file ; i mean when the file changed
(updated with new info); i want the cell changed outomatically with last

date
of updates; other wise the cell snad still as it be;

Many thanks for your time ;





All times are GMT +1. The time now is 08:59 PM.

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