This documentation is archived and is not being maintained.

Workbook.SheetActivate Event

Occurs when any sheet is activated.

Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in

public event WorkbookEvents_SheetActivateEventHandler SheetActivate

The following code example demonstrates a handler for the SheetActivate event. The event handler displays the name of the worksheet that is activated.

private void WorkbookSheetActivate()
    this.SheetActivate +=
        new Excel.WorkbookEvents_SheetActivateEventHandler(

private void ThisWorkbook_SheetActivate(object Sh)
    Excel.Worksheet sheet = (Excel.Worksheet)Sh;
    MessageBox.Show(sheet.Name + " Activated");