Partager via


WorkbookEvents_BeforeCloseEventHandler Delegate

A Delegate type used to add an event handler for the BeforeClose event. The BeforeClose event occurs before the workbook closes. If the workbook has been changed, this event occurs before the user is asked to save changes.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
<ComVisibleAttribute(False)> _
Public Delegate Sub WorkbookEvents_BeforeCloseEventHandler ( _
    <OutAttribute> ByRef Cancel As Boolean _
)
'Usage
Dim instance As New WorkbookEvents_BeforeCloseEventHandler(AddressOf HandlerMethod)
[ComVisibleAttribute(false)]
public delegate void WorkbookEvents_BeforeCloseEventHandler(
    out bool Cancel
)

Parameters

  • Cancel
    Type: System.Boolean

    False when the event occurs. If the event procedure sets this argument to True, the close operation stops and the workbook is left open.

See Also

Reference

Microsoft.Office.Interop.Excel Namespace