Workbook Events

Name

Parameters

Description

Activate

Triggered when the workbook is activated

Addinlnstall

Triggered when the workbook is opened as an Add-In

Addin Uninstall

Triggered when the workbook is opened as an Add-In is uninstalled

AfterXML Export

Map As XMLMap, URL As String, Result As xlXmlExportRsult

Triggered after XML data is exported

AfterXML Import

Map As XmlMap, IsRefresh As Boolean, Result as XlXmlImportResult

Triggered after XML data is refreshed or imported

BeforeClose

Cancel As Boolean

Triggered just before the workbook closes. Set the Cancel parameter to True to cancel the closing

BeforePrint

Cancel As Boolean

Triggered just before the workbook is printed. Set the Cancel parameter to True to cancel the printing

BeforeSave

SaveAsUI As Boolean, Cancel As Boolean

Triggered just before the workbook is saved. Set the Cancel parameter to True to cancel the saving. Set the SaveAsUI to True for the user to be prompted with the Save As dialog box

BeforeXML Export

Map As XMLMap, URL As String, Result As xlXml ExportRsult

Triggered before XML data is exported

Name

Parameters

Description

BeforeXML Import

Map As XmlMap,URL As String, IsRefreshAs Boolean, Result as XlXmlImportResult, Cancel As Boolean

Triggered before XML data is refreshed or imported

Deactivate

Triggered when the workbook loses focus

NewSheet

Sh As Object

Triggered when a new sheet is created in the workbook. The Sh parameter passes in the new sheet

Open

Triggered when the workbook is opened

PivotTable Close

Connection

ByVal Target As PivotTable

Triggered when a PivotTable report closes the connection to its data source. Target is the selected PivotTable

PivotTable Open

Connection

ByVal Target As PivotTable

Triggered when a PivotTable report opens the connection to its data source. Target is the selected PivotTable

RowSet Complete

Description As String, Sheet As String, Success As Boolean

Triggered when an OLAP drillthrough or rowset action has been completed

SheetActivate

Sh As Object

Triggered when a sheet is activated in the workbook. The Sh parameter passes in the activated sheet

SheetBefore DoubleClick

Sh As Object, Target As Range, Cancel As Boolean

Triggered when a sheet is about to be double-clicked. The sheet and the potential double-click spot are passed into the event. The double-click action can be canceled by setting the Cancel parameter to True

SheetBefore RightClick

Sh As Object, Target As Range, Cancel As Boolean

Triggered when a sheet is about to be right-clicked. The sheet and the potential right-click spot are passed into the event. The right-click action can be canceled by setting the Cancel parameter to True

Sheet Calculate

Sh As Object

Triggered when a sheet is recalculated passing in the recalculated sheet

SheetChange Range

Sh As Object, Target As

Triggered when the contents of a cell are changed in any worksheet in the workbook. For example, this can be triggered by entering new data, clearing the cell, or deleting a row/column. Not triggered when inserting rows/columns

Sheet

Deactivate

Sh As Object

Triggered when a sheet loses focus. Passes in the sheet

Name

Parameters

Description

SheetFollow Hyperlink

ShAs Object, Target As Hyperlink

Triggered when the user clicks a hyperlink on a sheet. Passes in the sheet and the clicked hyperlink

SheetPivot TableUpdate

As Object, Target As PivotTable

Triggered when the sheet of the PivotTable report has been updated

Sheet

Selection

Change

ShAs Object, Target As Range

Triggered when the user selects a different cell on the sheet. Passes in the new range and the sheet where the change occurred

SyncEvent

SyncEventType As MsoSyncEventType

Triggers when the local copy of a worksheet that is part of a Document Workspace is synchronized with the copy on the server

Window Activate

Wn As Window

Triggered when a workbook window is activated (brought up to the front of other workbook windows). The workbook and the window are passed in

Window Deactivate

Wn As Window

Triggered when a workbook window loses focus. The related workbook and the window are passed in

WindowResize

Wn As Window

Triggered when a workbook window is resized. The resized workbook and window are passed into the event

0 0

Post a comment