Excel.Interfaces.RangeData interface

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

Properties

address

Specifies the range reference in A1-style. Address value contains the sheet reference (e.g., "Sheet1!A1:B4").

addressLocal

Represents the range reference for the specified range in the language of the user.

cellCount

Specifies the number of cells in the range. This API will return -1 if the cell count exceeds 2^31-1 (2,147,483,647).

columnCount

Specifies the total number of columns in the range.

columnHidden

Represents if all columns in the current range are hidden. Value is true when all columns in a range are hidden. Value is false when no columns in the range are hidden. Value is null when some columns in a range are hidden and other columns in the same range are not hidden.

columnIndex

Specifies the column number of the first cell in the range. Zero-indexed.

format

Returns a format object, encapsulating the range's font, fill, borders, alignment, and other properties.

formulas

Represents the formula in A1-style notation. If a cell has no formula, its value is returned instead.

formulasLocal

Represents the formula in A1-style notation, in the user's language and number-formatting locale. For example, the English "=SUM(A1, 1.5)" formula would become "=SUMME(A1; 1,5)" in German. If a cell has no formula, its value is returned instead.

formulasR1C1

Represents the formula in R1C1-style notation. If a cell has no formula, its value is returned instead.

hidden

Represents if all cells in the current range are hidden. Value is true when all cells in a range are hidden. Value is false when no cells in the range are hidden. Value is null when some cells in a range are hidden and other cells in the same range are not hidden.

numberFormat

Represents Excel's number format code for the given range. For more information about Excel number formatting, see Number format codes.

rowCount

Returns the total number of rows in the range.

rowHidden

Represents if all rows in the current range are hidden. Value is true when all rows in a range are hidden. Value is false when no rows in the range are hidden. Value is null when some rows in a range are hidden and other rows in the same range are not hidden.

rowIndex

Returns the row number of the first cell in the range. Zero-indexed.

text

Text values of the specified range. The text value will not depend on the cell width. The number sign (#) substitution that happens in the Excel UI will not affect the text value returned by the API.

values

Represents the raw values of the specified range. The data returned could be a string, number, or boolean. Cells that contain an error will return the error string. If the returned value starts with a plus ("+"), minus ("-"), or equal sign ("="), Excel interprets this value as a formula.

valueTypes

Specifies the type of data in each cell.

Property Details

address

Specifies the range reference in A1-style. Address value contains the sheet reference (e.g., "Sheet1!A1:B4").

address?: string;

Property Value

string

Remarks

[ API set: ExcelApi 1.1 ]

addressLocal

Represents the range reference for the specified range in the language of the user.

addressLocal?: string;

Property Value

string

Remarks

[ API set: ExcelApi 1.1 ]

cellCount

Specifies the number of cells in the range. This API will return -1 if the cell count exceeds 2^31-1 (2,147,483,647).

cellCount?: number;

Property Value

number

Remarks

[ API set: ExcelApi 1.1 ]

columnCount

Specifies the total number of columns in the range.

columnCount?: number;

Property Value

number

Remarks

[ API set: ExcelApi 1.1 ]

columnHidden

Represents if all columns in the current range are hidden. Value is true when all columns in a range are hidden. Value is false when no columns in the range are hidden. Value is null when some columns in a range are hidden and other columns in the same range are not hidden.

columnHidden?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.2 ]

columnIndex

Specifies the column number of the first cell in the range. Zero-indexed.

columnIndex?: number;

Property Value

number

Remarks

[ API set: ExcelApi 1.1 ]

format

Returns a format object, encapsulating the range's font, fill, borders, alignment, and other properties.

format?: Excel.Interfaces.RangeFormatData;

Property Value

Remarks

[ API set: ExcelApi 1.1 ]

formulas

Represents the formula in A1-style notation. If a cell has no formula, its value is returned instead.

formulas?: any[][];

Property Value

any[][]

Remarks

[ API set: ExcelApi 1.1 ]

formulasLocal

Represents the formula in A1-style notation, in the user's language and number-formatting locale. For example, the English "=SUM(A1, 1.5)" formula would become "=SUMME(A1; 1,5)" in German. If a cell has no formula, its value is returned instead.

formulasLocal?: any[][];

Property Value

any[][]

Remarks

[ API set: ExcelApi 1.1 ]

formulasR1C1

Represents the formula in R1C1-style notation. If a cell has no formula, its value is returned instead.

formulasR1C1?: any[][];

Property Value

any[][]

Remarks

[ API set: ExcelApi 1.2 ]

hidden

Represents if all cells in the current range are hidden. Value is true when all cells in a range are hidden. Value is false when no cells in the range are hidden. Value is null when some cells in a range are hidden and other cells in the same range are not hidden.

hidden?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.2 ]

numberFormat

Represents Excel's number format code for the given range. For more information about Excel number formatting, see Number format codes.

numberFormat?: any[][];

Property Value

any[][]

Remarks

[ API set: ExcelApi 1.1 ]

rowCount

Returns the total number of rows in the range.

rowCount?: number;

Property Value

number

Remarks

[ API set: ExcelApi 1.1 ]

rowHidden

Represents if all rows in the current range are hidden. Value is true when all rows in a range are hidden. Value is false when no rows in the range are hidden. Value is null when some rows in a range are hidden and other rows in the same range are not hidden.

rowHidden?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.2 ]

rowIndex

Returns the row number of the first cell in the range. Zero-indexed.

rowIndex?: number;

Property Value

number

Remarks

[ API set: ExcelApi 1.1 ]

text

Text values of the specified range. The text value will not depend on the cell width. The number sign (#) substitution that happens in the Excel UI will not affect the text value returned by the API.

text?: string[][];

Property Value

string[][]

Remarks

[ API set: ExcelApi 1.1 ]

values

Represents the raw values of the specified range. The data returned could be a string, number, or boolean. Cells that contain an error will return the error string. If the returned value starts with a plus ("+"), minus ("-"), or equal sign ("="), Excel interprets this value as a formula.

values?: any[][];

Property Value

any[][]

Remarks

[ API set: ExcelApi 1.1 ]

valueTypes

Specifies the type of data in each cell.

valueTypes?: Excel.RangeValueType[][];

Property Value

Remarks

[ API set: ExcelApi 1.1 ]