We have large Excel reports with LOTS of PivotTables. Is there any way to change the data source on the existing PivotTables to change them from an External connection to use the internal Data Model from PowerPivot?
When I choose PivotTable Analyze > Change Data Source > Change Data Source...
it looks like I can change to a different external data source, but not an internal one.
I looked at VBA solutions, and:
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.
I would even be happy with a VBA solution that created new pivots and slicers using the old one as a guide. All the columns and tables names are the same. There are just too many pivots to manually migrate!
The answer is sadly NO. Because that is the restricted manner in which MS designed it. The good part is you can create a VBA
that loops through all of the PivotTables
in your workbook
, reads their properties (such as the fields used in the rows, columns, values, and filters areas), and then creates new PivotTables
using the internal Data Model
as the data source and sets their properties to match the original PivotTables
.
It is not possible to change the data source of an existing PivotTable
from an external connection to the internal Data Model from PowerPivot.
When you create a PivotTable
, you must choose the data source that the PivotTable (PTbs)
will use. Once the PivotTable is created, you can change the data source to a different external data source, but you cannot change it to use the internal Data Model.
A template VBA script that does this It uses internal source for its new PTbs