Excel.RangeView class
RangeView represents a set of visible cells of the parent range.
- Extends
Remarks
Properties
cell |
Represents the cell addresses of the |
column |
The number of visible columns. |
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. If a cell has no formula, its value is returned instead. |
formulas |
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. |
index | Returns a value that represents the index of the |
number |
Represents Excel's number format code for the given cell. |
row |
The number of visible rows. |
rows | Represents a collection of range views associated with the range. |
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. |
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. |
values |
A JSON representation of the values in the cells in this range. Unlike |
values |
A JSON representation of the values in the cells in this range. Unlike |
value |
Represents the type of data of each cell. |
Methods
get |
Gets the parent range associated with the current |
load(options) | Queues up a command to load the specified properties of the object. You must call |
load(property |
Queues up a command to load the specified properties of the object. You must call |
load(property |
Queues up a command to load the specified properties of the object. You must call |
set(properties, options) | Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. |
set(properties) | Sets multiple properties on the object at the same time, based on an existing loaded object. |
toJSON() | Overrides the JavaScript |
Property Details
cellAddresses
Represents the cell addresses of the RangeView
.
readonly cellAddresses: any[][];
Property Value
any[][]
Remarks
columnCount
The number of visible columns.
readonly columnCount: number;
Property Value
number
Remarks
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
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
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
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
index
Returns a value that represents the index of the RangeView
.
readonly index: number;
Property Value
number
Remarks
numberFormat
Represents Excel's number format code for the given cell.
numberFormat: any[][];
Property Value
any[][]
Remarks
rowCount
The number of visible rows.
readonly rowCount: number;
Property Value
number
Remarks
rows
Represents a collection of range views associated with the range.
readonly rows: Excel.RangeViewCollection;
Property Value
Remarks
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.
readonly text: string[][];
Property Value
string[][]
Remarks
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.
values: any[][];
Property Value
any[][]
Remarks
valuesAsJson
A JSON representation of the values in the cells in this range. Unlike RangeView.values
, RangeView.valuesAsJson
supports all data types which can be in a cell. Examples include formatted number values and web images, in addition to the standard boolean, number, and string values. Data returned from this API always aligns with the en-US locale. To retrieve data in the user's display locale, use RangeView.valuesAsJsonLocal
.
valuesAsJson: CellValue[][];
Property Value
Excel.CellValue[][]
Remarks
valuesAsJsonLocal
A JSON representation of the values in the cells in this range. Unlike RangeView.values
, RangeView.valuesAsJsonLocal
supports all data types which can be in a cell. Examples include formatted number values and web images, in addition to the standard boolean, number, and string values. Data returned from this API always aligns with the user's display locale. To retrieve data independent of locale, use RangeView.valuesAsJson
.
valuesAsJsonLocal: CellValue[][];
Property Value
Excel.CellValue[][]
Remarks
valueTypes
Represents the type of data of each cell.
readonly valueTypes: Excel.RangeValueType[][];
Property Value
Remarks
Method Details
getRange()
Gets the parent range associated with the current RangeView
.
getRange(): Excel.Range;
Returns
Remarks
load(options)
Queues up a command to load the specified properties of the object. You must call context.sync()
before reading the properties.
load(options?: Excel.Interfaces.RangeViewLoadOptions): Excel.RangeView;
Parameters
Provides options for which properties of the object to load.
Returns
load(propertyNames)
Queues up a command to load the specified properties of the object. You must call context.sync()
before reading the properties.
load(propertyNames?: string | string[]): Excel.RangeView;
Parameters
- propertyNames
-
string | string[]
A comma-delimited string or an array of strings that specify the properties to load.
Returns
load(propertyNamesAndPaths)
Queues up a command to load the specified properties of the object. You must call context.sync()
before reading the properties.
load(propertyNamesAndPaths?: {
select?: string;
expand?: string;
}): Excel.RangeView;
Parameters
- propertyNamesAndPaths
-
{ select?: string; expand?: string; }
propertyNamesAndPaths.select
is a comma-delimited string that specifies the properties to load, and propertyNamesAndPaths.expand
is a comma-delimited string that specifies the navigation properties to load.
Returns
set(properties, options)
Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type.
set(properties: Interfaces.RangeViewUpdateData, options?: OfficeExtension.UpdateOptions): void;
Parameters
- properties
- Excel.Interfaces.RangeViewUpdateData
A JavaScript object with properties that are structured isomorphically to the properties of the object on which the method is called.
- options
- OfficeExtension.UpdateOptions
Provides an option to suppress errors if the properties object tries to set any read-only properties.
Returns
void
set(properties)
Sets multiple properties on the object at the same time, based on an existing loaded object.
set(properties: Excel.RangeView): void;
Parameters
- properties
- Excel.RangeView
Returns
void
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
Office Add-ins