Workbook

EventDescription
ActivateEventOccurs when the focus is moved to this workbook. This replaces the earlier Activate event because there is already a workbook method called Activate.
AddinInstall (VBA)Occurs 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.
AddinUninstall (VBA)Occurs 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.
AfterSaveOccurs after the workbook has been saved.
AfterXMLExport (VBA)Occurs after data is exported to an XML data file.
AfterXMLImport (VBA)Occurs after data has been imported from an XML data file.
BeforeClose (VBA)Occurs before the workbook is closed.
BeforePrint (VBA)Occurs before the workbook is printed.
BeforeSaveOccurs before the workbook is saved.
BeforeXMLExport (VBA)Occurs before data is exported to an XML list.
BeforeXMLImport (VBA)Occurs before data is imported from an XML list.
Deactivate (VBA)Occurs when focus is moved from this workbook to another workbook or window.
Disposed 
NewChartOccurs when a new chart is created in the workbook.
NewSheet (VBA)Occurs before an additional worksheet is added to the workbook.
Open (VBA)Occurs before the workbook is opened.
PivotTableCloseConnection (VBA)Occurs when a pivottable closes its connection to its datasource.
PivotTableOpenConnection (VBA)Occurs when a pivottable opens its connection to its datasource.
RowsetComplete (VBA)Occurs when a user either drills through a recordset or involves the rowset action on an OLAP pivottable.
SheetActivate (VBA)Occurs when any worksheet in this workbook is selected. The activated sheet is passed an object which can be cast to either a worksheet or a chart sheet
SheetBeforeDoubleClick (VBA)Occurs before any cell is double clicked on any worksheet in this workbook.
SheetBeforeRightClick (VBA)Occurs before any cell is right mouse clicked on any worksheet in this workbook. This does not include Chart sheets.
SheetCalculate (VBA)Occurs after the user re-calculates any worksheet in this workbook. The activated sheet is passed an object which can be cast to either a worksheet or a chart sheet
SheetChange (VBA)Occurs when any cell is changed either by the user or by an external link. The activated sheet is passed an object although this is always a worksheet as this event is not raised for chart sheets
SheetDeactivate (VBA)Occurs when a different worksheet is selected in this workbook. The activated sheet is passed an object although this is always a worksheet as this event is not raised for chart sheets
SheetFollowHyperlink (VBA)Occurs when a hyperlink is clicked on a worksheet.
SheetPivotTableAfterValueChangeOccurs after a cell or range of cells inside a pivottable are edited or recalculated (for cells that contain formulas)
SheetPivotTableBeforeAllocateChangeOccurs before changes are applied to a pivottable.
SheetPivotTableBeforeCommitChangesOccurs before changes are committed against the OLAP data source for a pivottable.
SheetPivotTableBeforeDiscardChangesOccurs before changes to a pivottable are discarded.
SheetPivotTableChangeSyncOccurs after changes to a pivottable.
SheetPivotTableUpdate (VBA)Occurs when a pivot table on a worksheet is updated.
SheetSelectionChange (VBA)Occurs 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
Shutdown(VSTO document level) Occurs when the workbook host item shuts down. (document level ?)
Startup(VSTO document level) Occurs after the workbook is running and all the initialisation code in the assembly has been run. (document level ?)
SyncEventOccurs when a worksheet in a Document Workspace is synchronised with a copy of the worksheet on a server. This replaces the earlier Sync event because there is already a workbook method called Sync.
WindowActivate (VBA)Occurs when focus is moved to any window that displays this workbook.
WindowDeactivate (VBA)Occurs when any window is de-selected.
WindowResize (VBA)Occurs when any window that displays this workbook is resized, opened, maximised or minimised.

Workbook - Activate

Activate is the name of both a method and an event.

public void Event_WorkbookActivate() 
{
}

((Excel.WorkbookEvents_Event)gApplicationExcel.ActiveWorkbook).Activate +=
    new Excel.WorkbookEvents_ActivateEventHandler(Event_WorkbookActivate);

Addhandler CType(gApplicationExcel.ActiveWorkbook, Excel.WorkbookEvents_Event).Activate 
Public Sub Event_ApplicationNewWorkbook(ByVal workbook As Excel.Workbook)
End Sub

If you want to fire this event manually you can use the following code:

objworkbook = gApplicationExcel.Workbooks("WbkName") 
CType(objworkbook, Excel._Workbook).Activate()


© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext