ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   I want to insert the file properties into a cell for printing. (https://www.excelbanter.com/excel-discussion-misc-queries/129208-i-want-insert-file-properties-into-cell-printing.html)

Felicity

I want to insert the file properties into a cell for printing.
 
How can I retrieve file properties for printing in Excel spread sheets?

Gord Dibben

I want to insert the file properties into a cell for printing.
 
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


Gord Dibben MS Excel MVP

On Sun, 4 Feb 2007 20:38:00 -0800, Felicity
wrote:

How can I retrieve file properties for printing in Excel spread sheets?




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

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