Compartir a través de


ChartSheetBase.Calculate (Evento)

Se produce después de que el objeto Microsoft.Office.Tools.Excel.ChartSheetBase represente datos nuevos o cambiados.

Espacio de nombres:  Microsoft.Office.Tools.Excel
Ensamblado:  Microsoft.Office.Tools.Excel.v4.0.Utilities (en Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Sintaxis

'Declaración
Public Event Calculate As ChartEvents_CalculateEventHandler
public event ChartEvents_CalculateEventHandler Calculate

Ejemplos

El ejemplo de código siguiente muestra un controlador para el evento Calculate que muestra un cuadro de mensaje cuando cambian los datos de origen del objeto Microsoft.Office.Tools.Excel.ChartSheetBase actual.

Private Sub DisplayCalculations()
    Globals.Sheet1.Range("A1", "A5").Value2 = 22
    Globals.Sheet1.Range("B1", "B5").Value2 = 55

    Me.SetSourceData(Globals.Sheet1.Range("A1", "B5"), _
        Excel.XlRowCol.xlColumns)
    Me.ChartType = Excel.XlChartType.xl3DColumn

    ' This will raise the Calculate event.
    Globals.Sheet1.Range("A1").Value2 = 11
End Sub

Sub ChartSheet1_Calculate() Handles Me.Calculate
    MsgBox("The chart sheet plotted new data.")
End Sub
private void DisplayCalculations()
{
    Globals.Sheet1.Range["A1", "A5"].Value2 = 22;
    Globals.Sheet1.Range["B1", "B5"].Value2 = 55;

    this.SetSourceData(Globals.Sheet1.Range["A1", "B5"],
        Excel.XlRowCol.xlColumns);
    this.ChartType = Excel.XlChartType.xl3DColumn;

    this.Calculate +=
        new Excel.ChartEvents_CalculateEventHandler(
        ChartSheet1_Calculate);

    // This will raise the Calculate event.
    Globals.Sheet1.Range["A1"].Value2 = 11;
}

void ChartSheet1_Calculate()
{
    MessageBox.Show("The chart sheet plotted new data.");
}

Seguridad de .NET Framework

Vea también

Referencia

ChartSheetBase Clase

Microsoft.Office.Tools.Excel (Espacio de nombres)