BeforePrint Event [Excel 2003 VBA Language Reference]
Office Excel 2003 VBA Language Reference
BeforePrint Event [Excel 2003 VBA Language Reference]

Occurs before the workbook (or anything in it) is printed.

Private Sub Workbook_BeforePrint(Cancel As Boolean)

Cancel False when the event occurs. If the event procedure sets this argument to True, the workbook isn't printed when the procedure is finished.

Example

This example recalculates all worksheets in the active workbook before printing anything.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
    For Each wk in Worksheets
        wk.Calculate
    Next
End Sub
		


Applies to | Workbook Object



© 2010 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View