共用方式為


PivotTable.ChangeConnection Method

Changes the connection of the specified PivotTable.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Sub ChangeConnection ( _
    conn As WorkbookConnection _
)
'Usage
Dim instance As PivotTable
Dim conn As WorkbookConnection

instance.ChangeConnection(conn)
void ChangeConnection(
    WorkbookConnection conn
)

Parameters

Remarks

The ChangeConnection(WorkbookConnection) method can only be used with a PivotTable that is connected to an external data source. A run-time error will occur if the ChangeConnection(WorkbookConnection) method is used with a PivotTable that uses data stored on a worksheet as its data source.

See Also

Reference

PivotTable Interface

PivotTable Members

Microsoft.Office.Interop.Excel Namespace