? on "date last saved" in cell

C

chris w

I have seen the following from Frank posted a few times and I have yet to
make this work, what am I doing wrong? I have pasted the function in and
only recieve
#NAME?
in the cell.

Thank you,
chris

Hi
use the following UDF (only on workbook level):

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
=DOCPROPS("last save time")
(format cell as date)
 
B

Bob Phillips

Chris,

This is a custom UDF, so you need to place the code in a normal code module.
The #NAME suggest that it cannot find the UDF. If you passed an invalid
property it would give a #VALUE error.

--

HTH

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

chris w

OK, I was pasting it into a workbook code instead of inserting a new module,
thanx I have never done that.

Chris
 

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