Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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)
Syntax
'Declaration
Public Event ActivateEvent As DocEvents_ActivateEventHandler
public event DocEvents_ActivateEventHandler ActivateEvent
Examples
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.
Sub Worksheet1_ActivateEvent() Handles Me.ActivateEvent
MsgBox(Me.Name & " was activated.")
End Sub
private void WorksheetActivateEvent()
{
this.ActivateEvent +=
new Excel.DocEvents_ActivateEventHandler(
Worksheet1_ActivateEvent);
}
void Worksheet1_ActivateEvent()
{
MessageBox.Show(this.Name + " was activated.");
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.