Including document property values in Excel headers

D

d_m_y

I am using Excel 2003 and trying to set up a template that has the header and
footer already configured, and include data found in the document properties
(e.g., Title, Subject, Creator) and hopefully custom properties like 'Client'
and 'Version' and 'Version Date'.

Can someone explain how to define the headers and footers to incorporate
such document property elements ?

Thanks.
 
D

d_m_y

Just to be clear, I am looking for a solution that doesn't require macros to
be written to set up the header/footer with this information. Looking for a
simple solution where the document properties can be accessed like in MS Word
and incorporated into the Excel header/footer.

Thanks.
 
G

Gord Dibben

You will need macros to return the information you want.

Sample code................

Sub Stuff_In_Footer()
With ActiveSheet.PageSetup
.LeftFooter = _
ThisWorkbook.BuiltinDocumentProperties("Title") & " " & _
ThisWorkbook.BuiltinDocumentProperties("Subject") & " " & _
ThisWorkbook.BuiltinDocumentProperties("Author") & " " & _
Format(ThisWorkbook.BuiltinDocumentProperties("Creation Date"), _
"yyyy-mmm-dd hh:mm:ss")
.LeftHeader = ThisWorkbook.CustomDocumentProperties("Client")
End With
End Sub


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