WorksheetBase.Calculate Event

Definition

Occurs after the worksheet is recalculated.

public:
 event Microsoft::Office::Interop::Excel::DocEvents_CalculateEventHandler ^ Calculate;
public event Microsoft.Office.Interop.Excel.DocEvents_CalculateEventHandler Calculate;
member this.Calculate : Microsoft.Office.Interop.Excel.DocEvents_CalculateEventHandler 
Public Custom Event Calculate As DocEvents_CalculateEventHandler 

Event Type

Examples

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

This example is for a document-level customization.

private void WorksheetCalculate()
{
    this.Calculate += new 
        Excel.DocEvents_CalculateEventHandler(
        Worksheet1_Calculate);
}

void Worksheet1_Calculate()
{
    MessageBox.Show(this.Name + " is being calculated");
}
Sub Worksheet1_Calculate() Handles Me.Calculate
    MsgBox(Me.Name & " is being calculated")
End Sub

Applies to