Edit

Share via


PivotTable.ChangeConnection(WorkbookConnection) Method

Definition

Changes the connection of the specified PivotTable.

public:
 void ChangeConnection(Microsoft::Office::Interop::Excel::WorkbookConnection ^ conn);
public void ChangeConnection (Microsoft.Office.Interop.Excel.WorkbookConnection conn);
Public Sub ChangeConnection (conn As WorkbookConnection)

Parameters

conn
WorkbookConnection

Required WorkbookConnection object that represents the new connection for the PivotTable.

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.

Applies to