Excel 2002 Print File Properties

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to print an Excel 2002 file properties when priting the file?
 
Hi
what properties do you want to print (and where: header/footer or a
cell)?
 
Hi
you may use the following function (put this in a standard module):
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

Now add the following procedure in your workbook module (not in a
standard module)
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In Me.Worksheets
With wkSht.PageSetup
.LeftFooter = Format(DocProps("Creation date"),"MM/DD/YYYY")
.Centerfooter = Format(DocProps("last save
time"),"MM/DD/YYYY")
.RightFooter = DocProps("last author")
End With
Next wkSht
End Sub
 

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

Back
Top