This documentation is archived and is not being maintained.

WorkbookEvents_BeforeSaveEventHandler Delegate 

A Delegate type used to add an event handler for the BeforeSave event. The BeforeSave event occurs before the workbook is saved.

Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in microsoft.office.interop.excel.dll)

'Usage
Sub Sub1(SaveAsUI As Boolean, _
	Cancel As Boolean)
End Sub
Dim workbookEvents_BeforeSaveEventHandler1 As New WorkbookEvents_BeforeSaveEventHandler(AddressOf Sub1)

'Declaration
Public Delegate Sub WorkbookEvents_BeforeSaveEventHandler( _
	<InAttribute()> ByVal SaveAsUI As Boolean, _
	<InAttribute(), OutAttribute()> ByRef Cancel As Boolean _
)
public delegate void WorkbookEvents_BeforeSaveEventHandler(
	/*in*/boolean SaveAsUI, 
	/*in*/boolean Cancel
);
In JScript, you can use the delegates in the .NET Framework, but you cannot define your own.

Parameters

SaveAsUI

True if the Save As dialog box will be displayed.

Cancel

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

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

Show: