Text Functions

Last Saved (UDF)

User Defined Function to list the date the workbook was last saved.  Once installed, used in a cell simply as: =LastSaved()


Function LastSaved() As Date
'Jerry Beaucaire  (10/16/2009)
    LastSaved = ThisWorkbook.BuiltinDocumentProperties(12)
End Function

Any Document Property (UDF)

User Defined function that let's you specify what document property you want. Once installed, used in a cell as:  =DocInfo("Last Save Time")

The options you can use in this function are:
Title              Subject
Author             Keywords
Comments           Last author
Revision number    Application name
Last print date    Creation date
Last save time     Security
Category           Format
Manager            Company
Hyperlink base     Total Editing Time


In a normal module:

Function DocInfo(MyVal As String)
'Jerry Beaucaire  (11/17/2009)
    DocInfo = ThisWorkbook.BuiltinDocumentProperties(MyVal)
End Function

If using the Revision # property or the Total Editing Time property,
you have to set them yourself.

Put this code into the ThisWorkbook module:

Option Explicit
Public y As Date

Private Sub Workbook_Open()
    y = Now
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    ThisWorkbook.BuiltinDocumentProperties("Total Editing Time") = (Now - y) * 1440
    y = Now
    ThisWorkbook.BuiltinDocumentProperties("Revision Number") = _
        ThisWorkbook.BuiltinDocumentProperties("Revision Number") + 1
End Sub

Subpages (23): View All