PivotTableCollection Object (JavaScript API for Excel)

Represents a collection of all the PivotTables that are part of the workbook or worksheet.

Properties

Property Type Description Req. Set
items PivotTable[] A collection of pivotTable objects. Read-only. 1.3

See property access examples.

Relationships

None

Methods

Method Return Type Description Req. Set
getCount() int Gets the number of pivot tables in the collection. 1.4
getItem(name: string) PivotTable Gets a PivotTable by name. 1.3
getItemOrNullObject(name: string) PivotTable Gets a PivotTable by name. If the PivotTable does not exist, will return a null object. 1.4
refreshAll() void Refreshes all the pivot tables in the collection. 1.3

Method Details

getCount()

Gets the number of pivot tables in the collection.

Syntax

pivotTableCollectionObject.getCount();

Parameters

None

Returns

int

getItem(name: string)

Gets a PivotTable by name.

Syntax

pivotTableCollectionObject.getItem(name);

Parameters

Parameter Type Description
name string Name of the PivotTable to be retrieved.

Returns

PivotTable

getItemOrNullObject(name: string)

Gets a PivotTable by name. If the PivotTable does not exist, will return a null object.

Syntax

pivotTableCollectionObject.getItemOrNullObject(name);

Parameters

Parameter Type Description
name string Name of the PivotTable to be retrieved.

Returns

PivotTable

refreshAll()

Refreshes all the pivot tables in the collection.

Syntax

pivotTableCollectionObject.refreshAll();

Parameters

None

Returns

void

ns

void

s as delimited string or an array. Or, provide loadOption object.  

Returns

void

refreshAll()

Refreshes all the PivotTables in the collection.

Syntax

pivotTableCollectionObject.refreshAll();

Parameters

None

Returns

void