다음을 통해 공유


Application.WorkbookBeforePrint Event (Excel)

Occurs before any open workbook is printed.

Syntax

.WorkbookBeforePrint(Wb, Cancel)

A variable that represents an Application object.

Parameters

Name

Required/Optional

Data Type

Description

Wb

필수

Workbook

The workbook.

Cancel

필수

Boolean

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

Return Value

Nothing

Example

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

Private Sub App_WorkbookBeforePrint(ByVal Wb As Workbook, _ 
 Cancel As Boolean) 
 For Each wk in Wb.Worksheets 
 wk.Calculate 
 Next 
End Sub

참고 항목

개념

Application Object

Application Object Members