WorkbookBase.PivotTableOpenConnection (Evento)
Se produce después de que un informe de tabla dinámica abra la conexión con su origen de datos.
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 PivotTableOpenConnection As WorkbookEvents_PivotTableOpenConnectionEventHandler
public event WorkbookEvents_PivotTableOpenConnectionEventHandler PivotTableOpenConnection
Ejemplos
En el ejemplo de código siguiente se muestra un controlador para el evento PivotTableOpenConnection.El controlador de eventos muestra un mensaje cuando un informe de tabla dinámica abre la conexión a su origen de datos.
Se trata de un ejemplo para una personalización en el nivel del documento.
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.");
}
Seguridad de .NET Framework
- Plena confianza para el llamador inmediato. Un código de confianza parcial no puede utilizar este miembro. Para obtener más información, vea Utilizar bibliotecas de código que no es de plena confianza.