Partilhar via


WorkbookBase.SheetCalculate Event

Occurs after any worksheet is recalculated or after any changed data is plotted on a chart.

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 SheetCalculate As WorkbookEvents_SheetCalculateEventHandler
public event WorkbookEvents_SheetCalculateEventHandler SheetCalculate

Examples

The following code example demonstrates a handler for the SheetCalculate event. The event handler displays the name of the worksheet that is being calculated.

This example is for a document-level customization.

Sub ThisWorkbook_SheetCalculate(ByVal Sh As Object) _
    Handles Me.SheetCalculate
    MsgBox(CType(Sh, Excel.Worksheet).Name & " is being calculated")
End Sub
private void WorkbookSheetCalculate()
{
    this.SheetCalculate +=
        new Excel.WorkbookEvents_SheetCalculateEventHandler(
        ThisWorkbook_SheetCalculate);
}

void ThisWorkbook_SheetCalculate(object Sh)
{
    MessageBox.Show(((Excel.Worksheet)Sh).Name +
        " is being calculated");
}

.NET Framework Security

See Also

Reference

WorkbookBase Class

Microsoft.Office.Tools.Excel Namespace