Freigeben über


Workbook.PivotTableOpenConnection-Ereignis (2007 System)

Aktualisiert: November 2007

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

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

Public Event PivotTableOpenConnection As WorkbookEvents_PivotTableOpenConnectionEventHandler

Dim instance As Workbook
Dim handler As WorkbookEvents_PivotTableOpenConnectionEventHandler

AddHandler instance.PivotTableOpenConnection, handler
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.");
}

Berechtigungen

Siehe auch

Referenz

Workbook-Klasse

Workbook-Member

Microsoft.Office.Tools.Excel-Namespace