PivotTable.ChangePivotCache (Excel)

Changes the PivotCache object of the specified PivotTable.

The ChangePivotCache method can only be used with a PivotTable that uses data stored on a worksheet as its data source. A run-time error occurs if the ChangePivotCache method is used with a PivotTable that is connected to an external data source.

ChangePivotCache (PivotCache)

PivotCache: A PivotTable or PivotCache object that represents the new PivotCache for the specified PivotTable.


Dim strPivotCache As String: strPivotCache = 
ActiveCell.PivotTable.ChangePivotCache PivotCache:=strPivotCache