Workbook
Event | Description |
ActivateEvent | Occurs 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. |
AfterSave | Occurs 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. |
BeforeSave | Occurs 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 | |
NewChart | Occurs 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. |
SheetPivotTableAfterValueChange | Occurs after a cell or range of cells inside a pivottable are edited or recalculated (for cells that contain formulas) |
SheetPivotTableBeforeAllocateChange | Occurs before changes are applied to a pivottable. |
SheetPivotTableBeforeCommitChanges | Occurs before changes are committed against the OLAP data source for a pivottable. |
SheetPivotTableBeforeDiscardChanges | Occurs before changes to a pivottable are discarded. |
SheetPivotTableChangeSync | Occurs 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 ?) |
SyncEvent | Occurs 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()
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext