WorksheetBase.ActivateEvent Event

Occurs when the worksheet is activated.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

public event DocEvents_ActivateEventHandler ActivateEvent

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

This example is for a document-level customization.

private void WorksheetActivateEvent()
{
    this.ActivateEvent += 
        new Excel.DocEvents_ActivateEventHandler(
        Worksheet1_ActivateEvent);
}

void Worksheet1_ActivateEvent()
{
    MessageBox.Show(this.Name + " was activated.");
}

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft