Compartilhar via


Evento Workbook.PivotTableOpenConnection (sistema de 2007)

Ocorre depois que um relatório de tabela dinâmica abre a conexão à sua fonte de dados.

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

Sintaxe

Public Event PivotTableOpenConnection As WorkbookEvents_PivotTableOpenConnectionEventHandler

Dim instance As Workbook
Dim handler As WorkbookEvents_PivotTableOpenConnectionEventHandler

AddHandler instance.PivotTableOpenConnection, handler
public event WorkbookEvents_PivotTableOpenConnectionEventHandler PivotTableOpenConnection

Exemplos

O exemplo de código a seguir demonstra um manipulador para o PivotTableOpenConnection evento. O manipulador de eventos exibe uma mensagem quando um relatório de tabela dinâmica abre a conexão à sua fonte de dados.

Este exemplo é para uma personalização em nível de documento.

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

    MsgBox("The PivotTable connection for " & _
        Target.Name & " was opened.")
EndSub
privatevoid 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.");
}

Permissões

Consulte também

Referência

Workbook Classe

Membros Workbook

Namespace Microsoft.Office.Tools.Excel