SheetActivate Event
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

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");

© 2015 Microsoft