Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Param
newArea
newArea

An Area object representing the new data source in the same workbook.

Remarks
Example
Code Block
csharp
csharp
titleC#

Area newArea = worksheet.CreateArea("A1:C7");
pivotTable.ChangeDataSource(newArea);
Code Block
vbnet
vbnet
titlevb.net

Dim newArea As Area = worksheet.CreateArea("A1:C7")
pivotTable.ChangeDataSource(newArea)
Exceptions
Exception
ArgumentException
ArgumentException

If a null reference is passed in as parameter instead of a valid Area object, or if the new data source is not in the same workbook, or
if not all the cells in the first row of the new area contain a value for the column name, then an exception of type ArgumentException will be thrown.