Freigeben über


WorkbookBase.PivotTableOpenConnection-Ereignis

Tritt ein, wenn ein PivotTable-Bericht die Verbindung zur Datenquelle hergestellt hat.

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 PivotTableOpenConnection As WorkbookEvents_PivotTableOpenConnectionEventHandler
public event WorkbookEvents_PivotTableOpenConnectionEventHandler PivotTableOpenConnection

Beispiele

Im folgenden Codebeispiel wird ein Handler für das PivotTableOpenConnection-Ereignis veranschaulicht. Der Ereignishandler zeigt eine Meldung an, wenn ein PivotTable-Bericht die Verbindung zur Datenquelle herstellt.

Dieses Beispiel bezieht sich auf eine Anpassung auf Dokumentebene.

Sub ThisWorkbook_PivotTableOpenConnection( _
    ByVal Target As Excel.PivotTable) _
    Handles Me.PivotTableOpenConnection

    MsgBox("The PivotTable connection for " & _
        Target.Name & " was opened.")
End Sub
private void WorkbookPivotTableOpenConnection()
{
    this.PivotTableOpenConnection +=
        new Excel.WorkbookEvents_PivotTableOpenConnectionEventHandler(
        ThisWorkbook_PivotTableOpenConnection);
}

void ThisWorkbook_PivotTableOpenConnection(
    Excel.PivotTable Target)
{
    MessageBox.Show("The PivotTable connection for " + Target.Name +
        " was opened.");
}

.NET Framework-Sicherheit

Siehe auch

Referenz

WorkbookBase Klasse

Microsoft.Office.Tools.Excel-Namespace