ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel document properties insert into a cell (https://www.excelbanter.com/excel-discussion-misc-queries/1992-excel-document-properties-insert-into-cell.html)

Mark

Excel document properties insert into a cell
 
I would like to find a way to insert the data that is stored on the
"Properties" page of an excel document into the cell. In work and Visio I can
do it easily but I can't figure out how to do it in Excel. I know, it's
probably simple, but I just can't think that simple right now...

thanks
mark

Bob Phillips

Mark,

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



--

HTH

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


"Mark" wrote in message
...
I would like to find a way to insert the data that is stored on the
"Properties" page of an excel document into the cell. In work and Visio I

can
do it easily but I can't figure out how to do it in Excel. I know, it's
probably simple, but I just can't think that simple right now...

thanks
mark




Frank Kabel

Hi
use the following 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 for example in a cell (to get the last modification date)
=DOCPROPS("last save time")
(format cell as date)

--
Regards
Frank Kabel
Frankfurt, Germany

Mark wrote:
I would like to find a way to insert the data that is stored on the
"Properties" page of an excel document into the cell. In work and
Visio I can do it easily but I can't figure out how to do it in
Excel. I know, it's probably simple, but I just can't think that
simple right now...

thanks
mark




Mark

Man, not I fell really stupid. I have not used VB in Excel in a while and
totaly forgot about it.

Thanks.

Mark

"Frank Kabel" wrote:

Hi
use the following 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 for example in a cell (to get the last modification date)
=DOCPROPS("last save time")
(format cell as date)

--
Regards
Frank Kabel
Frankfurt, Germany

Mark wrote:
I would like to find a way to insert the data that is stored on the
"Properties" page of an excel document into the cell. In work and
Visio I can do it easily but I can't figure out how to do it in
Excel. I know, it's probably simple, but I just can't think that
simple right now...

thanks
mark






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

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