ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Displaying Document Properties in Excel (https://www.excelbanter.com/excel-worksheet-functions/111659-displaying-document-properties-excel.html)

AlwaysFroosh!

Displaying Document Properties in Excel
 
This should be pretty straight forward, but I can't find it for the life of
me. I have a document with a bunch of properties, and I want these properties
to be displayed in certain cells on my spreadsheet. What formula can I use to
retrieve the document property??
Thanks

Bob Phillips

Displaying Document Properties in Excel
 
'-----------------------------------------------------------------
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

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"AlwaysFroosh!" wrote in message
...
This should be pretty straight forward, but I can't find it for the life

of
me. I have a document with a bunch of properties, and I want these

properties
to be displayed in certain cells on my spreadsheet. What formula can I use

to
retrieve the document property??
Thanks




Gord Dibben

Displaying Document Properties in Excel
 
First off.........save a backup of your workbook.

Then use this User Defined Function

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

'=DOCPROPS("last author")
'or
'=DOCPROPS("last save time")
'or
'DOCPROPS("creation date")

For a list of other properties that may be available(not all are), run this
macro.

Sub props()
rw = 1
Worksheets.Add
For Each p In ActiveWorkbook.BuiltinDocumentProperties
Cells(rw, 1).Value = p.Name
rw = rw + 1
Next
End Sub


If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

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 InsertModule. Paste the above code in there. Save the
workbook and hit ALT + Q to return to Excel window.

Enter the formula as shown above.


Gord Dibben Excel MVP

On Tue, 26 Sep 2006 10:57:01 -0700, AlwaysFroosh!
wrote:

This should be pretty straight forward, but I can't find it for the life of
me. I have a document with a bunch of properties, and I want these properties
to be displayed in certain cells on my spreadsheet. What formula can I use to
retrieve the document property??
Thanks


Gord Dibben MS Excel MVP

CLR

Displaying Document Properties in Excel
 
Lots of info here.....

http://www.cpearson.com/excel/docprop.htm

Vaya con Dios,
Chuck, CABGx3



"AlwaysFroosh!" wrote:

This should be pretty straight forward, but I can't find it for the life of
me. I have a document with a bunch of properties, and I want these properties
to be displayed in certain cells on my spreadsheet. What formula can I use to
retrieve the document property??
Thanks



All times are GMT +1. The time now is 06:33 PM.

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