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")
Sub PathInFooter()
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub
NOTE: the code could be included in a Before_Print routine.
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub
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")
Sub PathInFooter()
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub
NOTE: the code could be included in a Before_Print routine.
Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub
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.