Sdílet prostřednictvím


WorkbookBase.SheetCalculate Event

Definition

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

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

Event Type

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.

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");
}
Sub ThisWorkbook_SheetCalculate(ByVal Sh As Object) _
    Handles Me.SheetCalculate
    MsgBox(CType(Sh, Excel.Worksheet).Name & " is being calculated")
End Sub

Applies to