Changes the data source of the PivotTable to a new Area.
PivotTable
Area
public void ChangeDataSource(Area newArea)
Public Sub ChangeDataSource(ByVal newArea As Area)
An Area object representing the new data source in the same workbook.
Area newArea = worksheet.CreateArea("A1:C7"); pivotTable.ChangeDataSource(newArea);
Dim newArea As Area = worksheet.CreateArea("A1:C7") pivotTable.ChangeDataSource(newArea)
An exception of type ArgumentException will be thrown if:
ArgumentException
null