WorkbookBeforeSave Event

See Also         Example         Applies To

Occurs before any open workbook is saved.

Syntax

Private Sub object_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUi As Boolean, ByVal Cancel As Boolean)

object   An object of type Application declared with events in a class module. For more information, see Using Events with the Application Object.

Wb   The workbook.

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.