Excel.Interfaces.SlicerData interface

An interface describing the data returned by calling slicer.toJSON().

Properties

caption

Represents the caption of the slicer.

height

Represents the height, in points, of the slicer. Throws an InvalidArgument exception when set with a negative value or zero as an input.

id

Represents the unique ID of the slicer.

isFilterCleared

Value is true if all filters currently applied on the slicer are cleared.

left

Represents the distance, in points, from the left side of the slicer to the left of the worksheet. Throws an InvalidArgument error when set with a negative value as an input.

name

Represents the name of the slicer.

nameInFormula

Represents the slicer name used in the formula.

slicerItems

Represents the collection of slicer items that are part of the slicer.

slicerStyle

The style applied to the slicer.

sortBy

Represents the sort order of the items in the slicer. Possible values are: "DataSourceOrder", "Ascending", "Descending".

style

Constant value that represents the slicer style. Possible values are: "SlicerStyleLight1" through "SlicerStyleLight6", "TableStyleOther1" through "TableStyleOther2", "SlicerStyleDark1" through "SlicerStyleDark6". A custom user-defined style present in the workbook can also be specified.

top

Represents the distance, in points, from the top edge of the slicer to the top of the worksheet. Throws an InvalidArgument error when set with a negative value as an input.

width

Represents the width, in points, of the slicer. Throws an InvalidArgument error when set with a negative value or zero as an input.

worksheet

Represents the worksheet containing the slicer.

Property Details

caption

Represents the caption of the slicer.

caption?: string;

Property Value

string

Remarks

[ API set: ExcelApi 1.10 ]

height

Represents the height, in points, of the slicer. Throws an InvalidArgument exception when set with a negative value or zero as an input.

height?: number;

Property Value

number

Remarks

[ API set: ExcelApi 1.10 ]

id

Represents the unique ID of the slicer.

id?: string;

Property Value

string

Remarks

[ API set: ExcelApi 1.10 ]

isFilterCleared

Value is true if all filters currently applied on the slicer are cleared.

isFilterCleared?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.10 ]

left

Represents the distance, in points, from the left side of the slicer to the left of the worksheet. Throws an InvalidArgument error when set with a negative value as an input.

left?: number;

Property Value

number

Remarks

[ API set: ExcelApi 1.10 ]

name

Represents the name of the slicer.

name?: string;

Property Value

string

Remarks

[ API set: ExcelApi 1.10 ]

nameInFormula

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Represents the slicer name used in the formula.

nameInFormula?: string;

Property Value

string

Remarks

[ API set: ExcelApi BETA (PREVIEW ONLY) ]

slicerItems

Represents the collection of slicer items that are part of the slicer.

slicerItems?: Excel.Interfaces.SlicerItemData[];

Property Value

Remarks

[ API set: ExcelApi 1.10 ]

slicerStyle

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

The style applied to the slicer.

slicerStyle?: Excel.Interfaces.SlicerStyleData;

Property Value

Remarks

[ API set: ExcelApi BETA (PREVIEW ONLY) ]

sortBy

Represents the sort order of the items in the slicer. Possible values are: "DataSourceOrder", "Ascending", "Descending".

sortBy?: Excel.SlicerSortType | "DataSourceOrder" | "Ascending" | "Descending";

Property Value

Excel.SlicerSortType | "DataSourceOrder" | "Ascending" | "Descending"

Remarks

[ API set: ExcelApi 1.10 ]

style

Constant value that represents the slicer style. Possible values are: "SlicerStyleLight1" through "SlicerStyleLight6", "TableStyleOther1" through "TableStyleOther2", "SlicerStyleDark1" through "SlicerStyleDark6". A custom user-defined style present in the workbook can also be specified.

style?: string;

Property Value

string

Remarks

[ API set: ExcelApi 1.10 ]

top

Represents the distance, in points, from the top edge of the slicer to the top of the worksheet. Throws an InvalidArgument error when set with a negative value as an input.

top?: number;

Property Value

number

Remarks

[ API set: ExcelApi 1.10 ]

width

Represents the width, in points, of the slicer. Throws an InvalidArgument error when set with a negative value or zero as an input.

width?: number;

Property Value

number

Remarks

[ API set: ExcelApi 1.10 ]

worksheet

Represents the worksheet containing the slicer.

worksheet?: Excel.Interfaces.WorksheetData;

Property Value

Remarks

[ API set: ExcelApi 1.10 ]