Excel.PivotTable class

Represents an Excel PivotTable.

[ API set: ExcelApi 1.3 ]

Extends
OfficeExtension.ClientObject

Remarks

Our how-to guide on working with PivotTables has detailed walkthroughs, images, and code samples.

Properties

id

Id of the PivotTable. Read-only.

[ API set: ExcelApi 1.5 ]

name

Name of the PivotTable.

[ API set: ExcelApi 1.3 ]

worksheet

The worksheet containing the current PivotTable.

[ API set: ExcelApi 1.3 ]

Methods

load(option)

Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties.

refresh()

Refreshes the PivotTable.

[ API set: ExcelApi 1.3 ]

toJSON()

Property Details

id

Id of the PivotTable. Read-only.

[ API set: ExcelApi 1.5 ]

readonly id: string;
Property Value
string

name

Name of the PivotTable.

[ API set: ExcelApi 1.3 ]

name: string;
Property Value
string

worksheet

The worksheet containing the current PivotTable.

[ API set: ExcelApi 1.3 ]

readonly worksheet: Excel.Worksheet;
Property Value

Method Details

load(option)

Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties.

load(option?: string | string[]): Excel.PivotTable;
Parameters
option
string | string[]

A comma-delimited string or an array of strings that specify the properties to load.

Returns
Remarks

In addition to this signature, this method has the following signatures:

load(option?: { select?: string; expand?: string; }): Excel.PivotTable - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load.

load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.PivotTable - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items.

refresh()

Refreshes the PivotTable.

[ API set: ExcelApi 1.3 ]

refresh(): void;
Returns
void

toJSON()

toJSON(): Excel.Interfaces.PivotTableData;
Returns