WorksheetBase.Calculate Event
Occurs after the worksheet is recalculated.
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 Calculate As DocEvents_CalculateEventHandler
public event DocEvents_CalculateEventHandler Calculate
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.
Sub Worksheet1_Calculate() Handles Me.Calculate
MsgBox(Me.Name & " is being calculated")
End Sub
private void WorksheetCalculate()
{
this.Calculate += new
Excel.DocEvents_CalculateEventHandler(
Worksheet1_Calculate);
}
void Worksheet1_Calculate()
{
MessageBox.Show(this.Name + " is being calculated");
}
.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.