WorksheetBase.ActivateEvent Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when the worksheet is activated.
public:
event Microsoft::Office::Interop::Excel::DocEvents_ActivateEventHandler ^ ActivateEvent;
public event Microsoft.Office.Interop.Excel.DocEvents_ActivateEventHandler ActivateEvent;
member this.ActivateEvent : Microsoft.Office.Interop.Excel.DocEvents_ActivateEventHandler
Public Custom Event ActivateEvent As DocEvents_ActivateEventHandler
Event Type
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.
private void WorksheetActivateEvent()
{
this.ActivateEvent +=
new Excel.DocEvents_ActivateEventHandler(
Worksheet1_ActivateEvent);
}
void Worksheet1_ActivateEvent()
{
MessageBox.Show(this.Name + " was activated.");
}
Sub Worksheet1_ActivateEvent() Handles Me.ActivateEvent
MsgBox(Me.Name & " was activated.")
End Sub