Document Properties - Last Saved, Author

  • Thread starter Michael Excel Dude
  • Start date
M

Michael Excel Dude

I tried adding the following function (from another post), in order to
automate documenting the last date changed/saved and the author:

'-----------------------------------------------------
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")
or
=DocProps ("last save time")
'-________________________________________________

I entered =DocProps("last author") in a cell, but get a "name" error.

Have I placed the Function in the wrong area? Add in problems?

Help appreciated.
 
G

Gord Dibben

Don't know where you placed the function code but it would go into the workbook
in a General Module.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module. Paste the above code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Enter the formula as you have below.


Gord Dibben Excel MVP



I tried adding the following function (from another post), in order to
automate documenting the last date changed/saved and the author:

'-----------------------------------------------------
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")
or
=DocProps ("last save time")
'-________________________________________________

I entered =DocProps("last author") in a cell, but get a "name" error.

Have I placed the Function in the wrong area? Add in problems?

Help appreciated.

Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top