Excel.RangeView class

RangeView represents a set of visible cells of the parent range.

[ API set: ExcelApi 1.3 ]

Extends

Properties

cellAddresses

Represents the cell addresses of the RangeView. Read-only.

[ API set: ExcelApi 1.3 ]

columnCount

Returns the number of visible columns. Read-only.

[ API set: ExcelApi 1.3 ]

context

The request context associated with the object. This connects the add-in's process to the Office host application's process.

formulas

Represents the formula in A1-style notation.

[ API set: ExcelApi 1.3 ]

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.

[ API set: ExcelApi 1.3 ]

formulasR1C1

Represents the formula in R1C1-style notation.

[ API set: ExcelApi 1.3 ]

index

Returns a value that represents the index of the RangeView. Read-only.

[ API set: ExcelApi 1.3 ]

numberFormat

Represents Excel's number format code for the given cell.

[ API set: ExcelApi 1.3 ]

rowCount

Returns the number of visible rows. Read-only.

[ API set: ExcelApi 1.3 ]

rows

Represents a collection of range views associated with the range. Read-only.

[ API set: ExcelApi 1.3 ]

text

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

[ API set: ExcelApi 1.3 ]

values

Represents the raw values of the specified range view. The data returned could be of type string, number, or a boolean. Cells that contain an error will return the error string.

[ API set: ExcelApi 1.3 ]

valueTypes

Represents the type of data of each cell. Read-only.

[ API set: ExcelApi 1.3 ]

Methods

getRange()

Gets the parent range associated with the current RangeView.

[ API set: ExcelApi 1.3 ]

load(option)

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

toJSON()

Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify, in turn, calls the toJSON method of the object that is passed to it.) Whereas the original Excel.RangeView object is an API object, the toJSON method returns a plain JavaScript object (typed as Excel.Interfaces.RangeViewData) that contains shallow copies of any loaded child properties from the original object.

Property Details

cellAddresses

Represents the cell addresses of the RangeView. Read-only.

[ API set: ExcelApi 1.3 ]

readonly cellAddresses: any[][];

Property Value

any[][]

columnCount

Returns the number of visible columns. Read-only.

[ API set: ExcelApi 1.3 ]

readonly columnCount: number;

Property Value

number

context

The request context associated with the object. This connects the add-in's process to the Office host application's process.

context: RequestContext;

Property Value

RequestContext

formulas

Represents the formula in A1-style notation.

[ API set: ExcelApi 1.3 ]

formulas: any[][];

Property Value

any[][]

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.

[ API set: ExcelApi 1.3 ]

formulasLocal: any[][];

Property Value

any[][]

formulasR1C1

Represents the formula in R1C1-style notation.

[ API set: ExcelApi 1.3 ]

formulasR1C1: any[][];

Property Value

any[][]

index

Returns a value that represents the index of the RangeView. Read-only.

[ API set: ExcelApi 1.3 ]

readonly index: number;

Property Value

number

numberFormat

Represents Excel's number format code for the given cell.

[ API set: ExcelApi 1.3 ]

numberFormat: any[][];

Property Value

any[][]

rowCount

Returns the number of visible rows. Read-only.

[ API set: ExcelApi 1.3 ]

readonly rowCount: number;

Property Value

number

rows

Represents a collection of range views associated with the range. Read-only.

[ API set: ExcelApi 1.3 ]

readonly rows: Excel.RangeViewCollection;

Property Value

text

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

[ API set: ExcelApi 1.3 ]

readonly text: string[][];

Property Value

string[][]

values

Represents the raw values of the specified range view. The data returned could be of type string, number, or a boolean. Cells that contain an error will return the error string.

[ API set: ExcelApi 1.3 ]

values: any[][];

Property Value

any[][]

valueTypes

Represents the type of data of each cell. Read-only.

[ API set: ExcelApi 1.3 ]

readonly valueTypes: Excel.RangeValueType[][];

Property Value

Excel.RangeValueType[][]

Method Details

getRange()

Gets the parent range associated with the current RangeView.

[ API set: ExcelApi 1.3 ]

getRange(): Excel.Range;

Returns

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.RangeView;

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.RangeView - 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.RangeView - 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.

toJSON()

Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify, in turn, calls the toJSON method of the object that is passed to it.) Whereas the original Excel.RangeView object is an API object, the toJSON method returns a plain JavaScript object (typed as Excel.Interfaces.RangeViewData) that contains shallow copies of any loaded child properties from the original object.

toJSON(): Excel.Interfaces.RangeViewData;

Returns