Including document property values in Excel headers

  • Thread starter Thread starter d_m_y
  • Start date Start date
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.
 
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.
 
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
 
Back
Top