WorksheetBase.Deactivate Event


Occurs when the worksheet loses focus.

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_DeactivateEventHandler Deactivate

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

This example is for a document-level customization.

private void WorksheetDeactivate()
    this.Deactivate += new 

void Worksheet1_Deactivate()
    MessageBox.Show(this.Name + " was deactivated");
Return to top