Workbook Level

EventDescription36516131007
Activate (VBA)
Cast (WorkbookEvents_Event)
Occurs when the focus is moved to this workbook.YYYYY
AddinInstallOccurs when the workbook is installed as an addin.
This event is only fired when an add-in is manually added to the (Tools > Add-ins) dialog box and not when Excel opens. This should be used instead of the Auto_Add macro.
YYYYY
AddinUninstallOccurs when the workbook is uninstalled as an addin.
This event is only fired when an add-in is manually removed from the (Tools > Add-ins) dialog box and not when Excel is closed. This should be used instead of the Auto_Remove macro.
YYYYY
AfterXMLExportOccurs after data is exported to an XML data file.YYYYY
AfterXMLImportOccurs after data has been imported from an XML data file.YYYYY
BeforeCloseOccurs before the workbook is closed. This should be used instead of the Auto_Close macro.YYYYY
BeforePrintOccurs before the workbook is printed.YYYYY
BeforeSaveOccurs before the workbook is saved. This should be used instead of the OnSave property.YYYYY
BeforeXMLExportOccurs before data is exported to an XML list.YYYYY
BeforeXMLImportOccurs before data is imported from an XML list.YYYYY
DeactivateOccurs when focus is moved from this workbook to another workbook or window.YYYYY
ModelChange YYY  
NewChartOccurs when a new chart is created in the workbook.YYYY 
NewSheetOccurs before an additional worksheet is added to the workbook.YYYYY
OpenOccurs before the workbook is opened. This should be used instead of the Auto_Open macro.YYYYY
PivotTableCloseConnectionOccurs when a pivottable closes its connection to its datasource.YYYYY
PivotTableOpenConnectionOccurs when a pivottable opens its connection to its datasource.YYYYY
RowsetCompleteOccurs when a user either drills through a recordset or involves the rowset action on an OLAP pivottable.YYYYY
SheetActivateOccurs when any worksheet in this workbook is selected. This should be used instead of the OnSheetActivate property.
The activated sheet is passed an object which can be cast to either a worksheet or a chart sheet
YYYYY
SheetBeforeDelete YYY  
SheetBeforeDoubleClickOccurs before any cell is double clicked on any worksheet in this workbook. This should be used instead of the OnDoubleClick property.YYYYY
SheetBeforeRightClickOccurs before any cell is right mouse clicked on any worksheet in this workbook. This does not include Chart sheets.YYYYY
SheetCalculateOccurs after the user re-calculates any worksheet in this workbook. This should be used instead of the OnCalculate property.
The activated sheet is passed an object which can be cast to either a worksheet or a chart sheet
YYYYY
SheetChangeOccurs when any cell is changed either by the user or by an external link. This should be used instead of the OnEntry property.
The activated sheet is passed an object although this is always a worksheet as this event is not raised for chart sheets
YYYYY
SheetDeactivateOccurs when a different worksheet is selected in this workbook. This should be used instead of the OnSheetDeactivate property.
The activated sheet is passed an object although this is always a worksheet as this event is not raised for chart sheets
YYYYY
SheetFollowHyperlinkOccurs when a hyperlink is clicked on a worksheet.YYYYY
SheetLensGalleryRenderComplete YYY  
SheetPivotTableAfterValueChangeOccurs after a cell or range of cells inside a pivottable are edited or recalculated (for cells that contain formulas)YYYY 
SheetPivotTableBeforeAllocateChangeOccurs before changes are applied to a pivottable.YYYY 
SheetPivotTableBeforeCommitChangesOccurs before changes are committed against the OLAP data source for a pivottable.YYYY 
SheetPivotTableBeforeDiscardChangesOccurs before changes to a pivottable are discarded.YYYY 
SheetPivotTableChangeSyncOccurs after changes to a pivottable.YYYY 
SheetPivotTableUpdateOccurs when a pivot table on a worksheet is updated.YYYYY
SheetSelectionChangeOccurs when the selection is changed on any worksheets in this workbook. This does not include Chart sheets.
The activated sheet is passed an object although this is always a worksheet as this event is not raised for chart sheets
YYYYY
SheetTableUpdate YYY  
SyncOccurs when a worksheet in a Document Workspace is synchronised with a copy of the worksheet on a server.YYYYY
WindowActivateOccurs when focus is moved to any window that displays this workbook. This should be used instead of the OnWindow property.YYYYY
WindowDeactivateOccurs when any window is de-selected. This should be used instead of the OnWindow property.YYYYY
WindowResizeOccurs when any window that displays this workbook is resized, opened, maximised or minimised.YYYYY


Event Procedures

Private Sub Workbook_Activate() 
End Sub

Private Sub Workbook_AddinInstall()
End Sub

Private Sub Workbook_AddinUninstall()
End Sub

Private Sub Workbook_AfterXmlExport(ByVal Map As XmlMap, _
                                    ByVal Url As String, _
                                    ByVal Result As XlXmlExportResult)
End Sub

Private Sub Workbook_AfterXmlImport(ByVal Map As XmlMap, _
                                    ByVal Url As String, _
                                    ByVal Result As XlXmlExportResult)
End Sub

Private Sub Workbook_BeforeClose(ByRef Cancel As Boolean)
'this runs before the workbook is closed and before the user is asked to save any changes
End Sub

Private Sub Workbook_BeforePrint(ByRef Cancel As Boolean)
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
                                ByRef Cancel As Boolean)
End Sub

Private Sub Workbook_BeforeXmlExport(ByVal Map As XmlMap, _
                                     ByVal Url As String, _
                                     ByRef Cancel As Boolean)
End Sub

Private Sub Workbook_BeforeXmlImport(ByVal Map As XmlMap, _
                                     ByVal Url As String, _
                                     ByVal IsRefresh As Boolean, _
                                     ByRef Cancel As Boolean)
End Sub

Private Sub Workbook_Deactivate()
End Sub

Private Sub Workbook_NewSheet(ByVal Sh As Object)
End Sub

Private Sub Workbook_Open()
End Sub

Private Sub Workbook_PivotTableCloseConnection(ByVal Target As PivotTable)
End Sub

Private Sub Workbook_PivotTableOpenConnection(ByVal Target As PivotTable)
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
End Sub

Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, _
                                            ByVal Target As Range, _
                                            ByRef Cancel As Boolean)
End Sub

Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, _
                                           ByVal Target As Range, _
                                           ByRef Cancel As Boolean)
End Sub

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
End Sub

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
                                 ByVal Target As Range)
End Sub

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
End Sub

Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, _
                                          ByVal Target As Hyperlink)
End Sub

Private Sub Workbook_SheetPivotTableUpdate(ByVal Sh As Object, _
                                           ByVal Target As PivotTable)
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
                                          ByVal Target As Range)
End Sub

Private Sub Workbook_Sync(ByVal SyncEventType As Office.MsoSyncEventType)
End Sub

Private Sub Workbook_WindowActivate(ByVal Wn As Window)
End Sub

Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
End Sub

Private Sub Workbook_WindowResize(ByVal Wn As Window)
End Sub

© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

PrevNext