PivotTable.RefreshDataSourceValues method (Excel)

Retrieves the current values from the data source for all edited cells in a PivotTable report that is in writeback mode.

Syntax

expression.RefreshDataSourceValues

expression A variable that represents a PivotTable object.

Return value

Nothing

Remarks

To determine if a PivotTable report is in writeback mode, check the EnableWriteback or EnableDataValueEditing properties of the PivotTable object, either of which will return True. For PivotTable reports that are not in writeback mode, trying to execute this method generates a run-time error.

For PivotTable reports with OLAP data sources, executing the RefreshDataSourceValues method creates a separate connection to the OLAP server and executes the full MDX query (the value of the MDX property) that is used to perform an update operation to populate the PivotTable report. Excel extracts the values returned for all cells that have been edited in the PivotTable view, and then stores them in the DataSourceValue property for those cells.

This method applies only to PivotTable reports with OLAP data sources. Trying to execute this method or PivotTable reports with non-OLAP data sources generates a run-time error.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.