Workbook Object Events

Microsoft Excel Visual Basic

Workbook Object Events

   

Workbook events occur when the workbook changes, when any sheet in the workbook changes, when add-ins change, or when PivotTables change. Events on workbooks are enabled by default. To view the event procedures for a workbook, right-click the title bar of a restored or minimized workbook window and click View Code on the shortcut menu. Select the event name from the Procedure drop-down list box.

Activate

AddinInstall

AddinUninstall

BeforeClose

BeforePrint

BeforeSave

Deactivate

NewSheet

Open

PivotTableCloseConnection

PivotTableOpenConnection

SheetActivate

SheetBeforeDoubleClick

SheetBeforeRightClick

SheetCalculate

SheetChange

SheetDeactivate

SheetFollowHyperlink

SheetPivotTableUpdate

SheetSelectionChange

WindowActivate

WindowDeactivate

WindowResize

This example maximizes Microsoft Excel when the workbook is opened

Sub Workbook_Open()
    Application.WindowState = xlMaximized
End Sub