Partager via


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.

Version Information

Version Added: Excel 2010

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 PivotTable.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.

See Also

Concepts

PivotTable Object

PivotTable Object Members