Excel.RangeAreas class

RangeAreas represents a collection of one or more rectangular ranges in the same worksheet. To learn how to use discontinguous ranges, read Work with multiple ranges simultaneously in Excel add-ins.

[ API set: ExcelApi 1.9 ]

Extends
OfficeExtension.ClientObject

Properties

address

Returns the RageAreas reference in A1-style. Address value will contain the worksheet name for each rectangular block of cells (e.g. "Sheet1!A1:B4, Sheet1!D1:D4"). Read-only.

[ API set: ExcelApi 1.9 ]

addressLocal

Returns the RageAreas reference in the user locale. Read-only.

[ API set: ExcelApi 1.9 ]

areaCount

Returns the number of rectangular ranges that comprise this RangeAreas object.

[ API set: ExcelApi 1.9 ]

areas

Returns a collection of rectangular ranges that comprise this RangeAreas object.

[ API set: ExcelApi 1.9 ]

cellCount

Returns the number of cells in the RangeAreas object, summing up the cell counts of all of the individual rectangular ranges. Returns -1 if the cell count exceeds 2^31-1 (2,147,483,647). Read-only.

[ API set: ExcelApi 1.9 ]

conditionalFormats

Returns a collection of ConditionalFormats that intersect with any cells in this RangeAreas object. Read-only.

[ API set: ExcelApi 1.9 ]

context

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

dataValidation

Returns a dataValidation object for all ranges in the RangeAreas.

[ API set: ExcelApi 1.9 ]

format

Returns a rangeFormat object, encapsulating the the font, fill, borders, alignment, and other properties for all ranges in the RangeAreas object. Read-only.

[ API set: ExcelApi 1.9 ]

isEntireColumn

Indicates whether all the ranges on this RangeAreas object represent entire columns (e.g., "A:C, Q:Z"). Read-only.

[ API set: ExcelApi 1.9 ]

isEntireRow

Indicates whether all the ranges on this RangeAreas object represent entire rows (e.g., "1:3, 5:7"). Read-only.

[ API set: ExcelApi 1.9 ]

style

Represents the style for all ranges in this RangeAreas object. If the styles of the cells are inconsistent, null will be returned. For custom styles, the style name will be returned. For built-in styles, a string representing a value in the BuiltInStyle enum will be returned.

[ API set: ExcelApi 1.9 ]

worksheet

Returns the worksheet for the current RangeAreas. Read-only.

[ API set: ExcelApi 1.9 ]

Methods

calculate()

Calculates all cells in the RangeAreas.

[ API set: ExcelApi 1.9 ]

clear(applyTo)

Clears values, format, fill, border, etc on each of the areas that comprise this RangeAreas object.

[ API set: ExcelApi 1.9 ]

clear(applyToString)

Clears values, format, fill, border, etc on each of the areas that comprise this RangeAreas object.

[ API set: ExcelApi 1.9 ]

convertDataTypeToText()

Converts all cells in the RangeAreas with datatypes into text.

[ API set: ExcelApi 1.9 ]

convertToLinkedDataType(serviceID, languageCulture)

Converts all cells in the RangeAreas into linked datatype.

[ API set: ExcelApi 1.9 ]

copyFrom(sourceRange, copyType, skipBlanks, transpose)

Copies cell data or formatting from the source range or RangeAreas to the current RangeAreas. The destination rangeAreas can be of different size than the source range or RangeAreas. The destination will be expanded automatically if it is smaller than the source.

[ API set: ExcelApi 1.9 ]

copyFrom(sourceRange, copyTypeString, skipBlanks, transpose)

Copies cell data or formatting from the source range or RangeAreas to the current RangeAreas. The destination rangeAreas can be of different size than the source range or RangeAreas. The destination will be expanded automatically if it is smaller than the source.

[ API set: ExcelApi 1.9 ]

getEntireColumn()

Returns a RangeAreas object that represents the entire columns of the RangeAreas (for example, if the current RangeAreas represents cells "B4:E11, H2", it returns a RangeAreas that represents columns "B:E, H:H").

[ API set: ExcelApi 1.9 ]

getEntireRow()

Returns a RangeAreas object that represents the entire rows of the RangeAreas (for example, if the current RangeAreas represents cells "B4:E11", it returns a RangeAreas that represents rows "4:11").

[ API set: ExcelApi 1.9 ]

getIntersection(anotherRange)

Returns the RangeAreas object that represents the intersection of the given ranges or RangeAreas. If no intersection is found, an ItemNotFound error will be thrown.

[ API set: ExcelApi 1.9 ]

getIntersectionOrNullObject(anotherRange)

Returns the RangeAreas object that represents the intersection of the given ranges or RangeAreas. If no intersection is found, a null object is returned.

[ API set: ExcelApi 1.9 ]

getOffsetRangeAreas(rowOffset, columnOffset)

Returns an RangeAreas object that is shifted by the specific row and column offset. The dimension of the returned RangeAreas will match the original object. If the resulting RangeAreas is forced outside the bounds of the worksheet grid, an error will be thrown.

[ API set: ExcelApi 1.9 ]

getSpecialCells(cellType, cellValueType)

Returns a RangeAreas object that represents all the cells that match the specified type and value. Throws an error if no special cells are found that match the criteria.

[ API set: ExcelApi 1.9 ]

getSpecialCells(cellTypeString, cellValueType)

Returns a RangeAreas object that represents all the cells that match the specified type and value. Throws an error if no special cells are found that match the criteria.

[ API set: ExcelApi 1.9 ]

getSpecialCellsOrNullObject(cellType, cellValueType)

Returns a RangeAreas object that represents all the cells that match the specified type and value. Returns a null object if no special cells are found that match the criteria.

[ API set: ExcelApi 1.9 ]

getSpecialCellsOrNullObject(cellTypeString, cellValueType)

Returns a RangeAreas object that represents all the cells that match the specified type and value. Returns a null object if no special cells are found that match the criteria.

[ API set: ExcelApi 1.9 ]

getTables(fullyContained)

Returns a scoped collection of tables that overlap with any range in this RangeAreas object.

[ API set: ExcelApi 1.9 ]

getUsedRangeAreas(valuesOnly)

Returns the used RangeAreas that comprises all the used areas of individual rectangular ranges in the RangeAreas object. If there are no used cells within the RangeAreas, the ItemNotFound error will be thrown.

[ API set: ExcelApi 1.9 ]

getUsedRangeAreasOrNullObject(valuesOnly)

Returns the used RangeAreas that comprises all the used areas of individual rectangular ranges in the RangeAreas object. If there are no used cells within the RangeAreas, a null object will be returned.

[ API set: ExcelApi 1.9 ]

load(option)

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

load(propertyNames)

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

load(propertyNamesAndPaths)

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

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.

setDirty()

Sets the RangeAreas to be recalculated when the next recalculation occurs.

[ API set: ExcelApi 1.9 ]

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.RangeAreas object is an API object, the toJSON method returns a plain JavaScript object (typed as Excel.Interfaces.RangeAreasData) that contains shallow copies of any loaded child properties from the original object.

track()

Track the object for automatic adjustment based on surrounding changes in the document. This call is a shorthand for context.trackedObjects.add(thisObject). If you are using this object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created.

untrack()

Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect.

Property Details

address

Returns the RageAreas reference in A1-style. Address value will contain the worksheet name for each rectangular block of cells (e.g. "Sheet1!A1:B4, Sheet1!D1:D4"). Read-only.

[ API set: ExcelApi 1.9 ]

readonly address: string;

Property Value

string

addressLocal

Returns the RageAreas reference in the user locale. Read-only.

[ API set: ExcelApi 1.9 ]

readonly addressLocal: string;

Property Value

string

areaCount

Returns the number of rectangular ranges that comprise this RangeAreas object.

[ API set: ExcelApi 1.9 ]

readonly areaCount: number;

Property Value

number

areas

Returns a collection of rectangular ranges that comprise this RangeAreas object.

[ API set: ExcelApi 1.9 ]

readonly areas: Excel.RangeCollection;

Property Value

cellCount

Returns the number of cells in the RangeAreas object, summing up the cell counts of all of the individual rectangular ranges. Returns -1 if the cell count exceeds 2^31-1 (2,147,483,647). Read-only.

[ API set: ExcelApi 1.9 ]

readonly cellCount: number;

Property Value

number

conditionalFormats

Returns a collection of ConditionalFormats that intersect with any cells in this RangeAreas object. Read-only.

[ API set: ExcelApi 1.9 ]

readonly conditionalFormats: Excel.ConditionalFormatCollection;

Property Value

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

dataValidation

Returns a dataValidation object for all ranges in the RangeAreas.

[ API set: ExcelApi 1.9 ]

readonly dataValidation: Excel.DataValidation;

Property Value

format

Returns a rangeFormat object, encapsulating the the font, fill, borders, alignment, and other properties for all ranges in the RangeAreas object. Read-only.

[ API set: ExcelApi 1.9 ]

readonly format: Excel.RangeFormat;

Property Value

Examples

await Excel.run(async (context) => {

    const sheet = context.workbook.worksheets.getActiveWorksheet();
    const usedRange = sheet.getUsedRange();

    // Find the ranges with formulas.
    const formulaRanges = usedRange.getSpecialCells("Formulas");
    formulaRanges.format.fill.color = "lightgreen";

    await context.sync();
});

isEntireColumn

Indicates whether all the ranges on this RangeAreas object represent entire columns (e.g., "A:C, Q:Z"). Read-only.

[ API set: ExcelApi 1.9 ]

readonly isEntireColumn: boolean;

Property Value

boolean

isEntireRow

Indicates whether all the ranges on this RangeAreas object represent entire rows (e.g., "1:3, 5:7"). Read-only.

[ API set: ExcelApi 1.9 ]

readonly isEntireRow: boolean;

Property Value

boolean

style

Represents the style for all ranges in this RangeAreas object. If the styles of the cells are inconsistent, null will be returned. For custom styles, the style name will be returned. For built-in styles, a string representing a value in the BuiltInStyle enum will be returned.

[ API set: ExcelApi 1.9 ]

style: string;

Property Value

string

worksheet

Returns the worksheet for the current RangeAreas. Read-only.

[ API set: ExcelApi 1.9 ]

readonly worksheet: Excel.Worksheet;

Property Value

Method Details

calculate()

Calculates all cells in the RangeAreas.

[ API set: ExcelApi 1.9 ]

calculate(): void;

Returns

void

clear(applyTo)

Clears values, format, fill, border, etc on each of the areas that comprise this RangeAreas object.

[ API set: ExcelApi 1.9 ]

clear(applyTo?: Excel.ClearApplyTo): void;

Parameters

applyTo
Excel.ClearApplyTo

Optional. Determines the type of clear action. See Excel.ClearApplyTo for details. Default is "All".

Returns

void

clear(applyToString)

Clears values, format, fill, border, etc on each of the areas that comprise this RangeAreas object.

[ API set: ExcelApi 1.9 ]

clear(applyToString?: "All" | "Formats" | "Contents" | "Hyperlinks" | "RemoveHyperlinks"): void;

Parameters

applyToString
"All" | "Formats" | "Contents" | "Hyperlinks" | "RemoveHyperlinks"

Optional. Determines the type of clear action. See Excel.ClearApplyTo for details. Default is "All".

Returns

void

convertDataTypeToText()

Converts all cells in the RangeAreas with datatypes into text.

[ API set: ExcelApi 1.9 ]

convertDataTypeToText(): void;

Returns

void

convertToLinkedDataType(serviceID, languageCulture)

Converts all cells in the RangeAreas into linked datatype.

[ API set: ExcelApi 1.9 ]

convertToLinkedDataType(serviceID: number, languageCulture: string): void;

Parameters

serviceID
number

The Service ID which will be used to query the data.

languageCulture
string

Language Culture to query the service for.

Returns

void

copyFrom(sourceRange, copyType, skipBlanks, transpose)

Copies cell data or formatting from the source range or RangeAreas to the current RangeAreas. The destination rangeAreas can be of different size than the source range or RangeAreas. The destination will be expanded automatically if it is smaller than the source.

[ API set: ExcelApi 1.9 ]

copyFrom(sourceRange: Range | RangeAreas | string, copyType?: Excel.RangeCopyType, skipBlanks?: boolean, transpose?: boolean): void;

Parameters

sourceRange
Range | RangeAreas | string

The source range or RangeAreas to copy from. When the source RangeAreas has multiple ranges, it must be in the outline form which can be created by removing full rows or columns from a rectangular range.

copyType
Excel.RangeCopyType

The type of cell data or formatting to copy over. Default is "All".

skipBlanks
boolean

True if to skip blank cells in the source range or RangeAreas. Default is false.

transpose
boolean

True if to transpose the cells in the destination RangeAreas. Default is false.

Returns

void

copyFrom(sourceRange, copyTypeString, skipBlanks, transpose)

Copies cell data or formatting from the source range or RangeAreas to the current RangeAreas. The destination rangeAreas can be of different size than the source range or RangeAreas. The destination will be expanded automatically if it is smaller than the source.

[ API set: ExcelApi 1.9 ]

copyFrom(sourceRange: Range | RangeAreas | string, copyTypeString?: "All" | "Formulas" | "Values" | "Formats", skipBlanks?: boolean, transpose?: boolean): void;

Parameters

sourceRange
Range | RangeAreas | string

The source range or RangeAreas to copy from. When the source RangeAreas has multiple ranges, it must be in the outline form which can be created by removing full rows or columns from a rectangular range.

copyTypeString
"All" | "Formulas" | "Values" | "Formats"

The type of cell data or formatting to copy over. Default is "All".

skipBlanks
boolean

True if to skip blank cells in the source range or RangeAreas. Default is false.

transpose
boolean

True if to transpose the cells in the destination RangeAreas. Default is false.

Returns

void

getEntireColumn()

Returns a RangeAreas object that represents the entire columns of the RangeAreas (for example, if the current RangeAreas represents cells "B4:E11, H2", it returns a RangeAreas that represents columns "B:E, H:H").

[ API set: ExcelApi 1.9 ]

getEntireColumn(): Excel.RangeAreas;

Returns

getEntireRow()

Returns a RangeAreas object that represents the entire rows of the RangeAreas (for example, if the current RangeAreas represents cells "B4:E11", it returns a RangeAreas that represents rows "4:11").

[ API set: ExcelApi 1.9 ]

getEntireRow(): Excel.RangeAreas;

Returns

getIntersection(anotherRange)

Returns the RangeAreas object that represents the intersection of the given ranges or RangeAreas. If no intersection is found, an ItemNotFound error will be thrown.

[ API set: ExcelApi 1.9 ]

getIntersection(anotherRange: Range | RangeAreas | string): Excel.RangeAreas;

Parameters

anotherRange
Range | RangeAreas | string

The range, RangeAreas object or range address that will be used to determine the intersection.

Returns

getIntersectionOrNullObject(anotherRange)

Returns the RangeAreas object that represents the intersection of the given ranges or RangeAreas. If no intersection is found, a null object is returned.

[ API set: ExcelApi 1.9 ]

getIntersectionOrNullObject(anotherRange: Range | RangeAreas | string): Excel.RangeAreas;

Parameters

anotherRange
Range | RangeAreas | string

The range, RangeAreas, or address that will be used to determine the intersection.

Returns

getOffsetRangeAreas(rowOffset, columnOffset)

Returns an RangeAreas object that is shifted by the specific row and column offset. The dimension of the returned RangeAreas will match the original object. If the resulting RangeAreas is forced outside the bounds of the worksheet grid, an error will be thrown.

[ API set: ExcelApi 1.9 ]

getOffsetRangeAreas(rowOffset: number, columnOffset: number): Excel.RangeAreas;

Parameters

rowOffset
number

The number of rows (positive, negative, or 0) by which the RangeAreas is to be offset. Positive values are offset downward, and negative values are offset upward.

columnOffset
number

The number of columns (positive, negative, or 0) by which the RangeAreas is to be offset. Positive values are offset to the right, and negative values are offset to the left.

Returns

getSpecialCells(cellType, cellValueType)

Returns a RangeAreas object that represents all the cells that match the specified type and value. Throws an error if no special cells are found that match the criteria.

[ API set: ExcelApi 1.9 ]

getSpecialCells(cellType: Excel.SpecialCellType, cellValueType?: Excel.SpecialCellValueType): Excel.RangeAreas;

Parameters

cellType
Excel.SpecialCellType

The type of cells to include.

cellValueType
Excel.SpecialCellValueType

If cellType is either Constants or Formulas, this argument is used to determine which types of cells to include in the result. These values can be combined together to return more than one type. The default is to select all constants or formulas, no matter what the type.

Returns

getSpecialCells(cellTypeString, cellValueType)

Returns a RangeAreas object that represents all the cells that match the specified type and value. Throws an error if no special cells are found that match the criteria.

[ API set: ExcelApi 1.9 ]

getSpecialCells(cellTypeString: "ConditionalFormats" | "DataValidations" | "Blanks" | "Constants" | "Formulas" | "SameConditionalFormat" | "SameDataValidation" | "Visible", cellValueType?: "All" | "Errors" | "ErrorsLogical" | "ErrorsNumbers" | "ErrorsText" | "ErrorsLogicalNumber" | "ErrorsLogicalText" | "ErrorsNumberText" | "Logical" | "LogicalNumbers" | "LogicalText" | "LogicalNumbersText" | "Numbers" | "NumbersText" | "Text"): Excel.RangeAreas;

Parameters

cellTypeString
"ConditionalFormats" | "DataValidations" | "Blanks" | "Constants" | "Formulas" | "SameConditionalFormat" | "SameDataValidation" | "Visible"

The type of cells to include.

cellValueType
"All" | "Errors" | "ErrorsLogical" | "ErrorsNumbers" | "ErrorsText" | "ErrorsLogicalNumber" | "ErrorsLogicalText" | "ErrorsNumberText" | "Logical" | "LogicalNumbers" | "LogicalText" | "LogicalNumbersText" | "Numbers" | "NumbersText" | "Text"

If cellType is either Constants or Formulas, this argument is used to determine which types of cells to include in the result. These values can be combined together to return more than one type. The default is to select all constants or formulas, no matter what the type.

Returns

getSpecialCellsOrNullObject(cellType, cellValueType)

Returns a RangeAreas object that represents all the cells that match the specified type and value. Returns a null object if no special cells are found that match the criteria.

[ API set: ExcelApi 1.9 ]

getSpecialCellsOrNullObject(cellType: Excel.SpecialCellType, cellValueType?: Excel.SpecialCellValueType): Excel.RangeAreas;

Parameters

cellType
Excel.SpecialCellType

The type of cells to include.

cellValueType
Excel.SpecialCellValueType

If cellType is either Constants or Formulas, this argument is used to determine which types of cells to include in the result. These values can be combined together to return more than one type. The default is to select all constants or formulas, no matter what the type.

Returns

getSpecialCellsOrNullObject(cellTypeString, cellValueType)

Returns a RangeAreas object that represents all the cells that match the specified type and value. Returns a null object if no special cells are found that match the criteria.

[ API set: ExcelApi 1.9 ]

getSpecialCellsOrNullObject(cellTypeString: "ConditionalFormats" | "DataValidations" | "Blanks" | "Constants" | "Formulas" | "SameConditionalFormat" | "SameDataValidation" | "Visible", cellValueType?: "All" | "Errors" | "ErrorsLogical" | "ErrorsNumbers" | "ErrorsText" | "ErrorsLogicalNumber" | "ErrorsLogicalText" | "ErrorsNumberText" | "Logical" | "LogicalNumbers" | "LogicalText" | "LogicalNumbersText" | "Numbers" | "NumbersText" | "Text"): Excel.RangeAreas;

Parameters

cellTypeString
"ConditionalFormats" | "DataValidations" | "Blanks" | "Constants" | "Formulas" | "SameConditionalFormat" | "SameDataValidation" | "Visible"

The type of cells to include.

cellValueType
"All" | "Errors" | "ErrorsLogical" | "ErrorsNumbers" | "ErrorsText" | "ErrorsLogicalNumber" | "ErrorsLogicalText" | "ErrorsNumberText" | "Logical" | "LogicalNumbers" | "LogicalText" | "LogicalNumbersText" | "Numbers" | "NumbersText" | "Text"

If cellType is either Constants or Formulas, this argument is used to determine which types of cells to include in the result. These values can be combined together to return more than one type. The default is to select all constants or formulas, no matter what the type.

Returns

getTables(fullyContained)

Returns a scoped collection of tables that overlap with any range in this RangeAreas object.

[ API set: ExcelApi 1.9 ]

getTables(fullyContained?: boolean): Excel.TableScopedCollection;

Parameters

fullyContained
boolean

If true, returns only tables that are fully contained within the range bounds. Default is false.

Returns

getUsedRangeAreas(valuesOnly)

Returns the used RangeAreas that comprises all the used areas of individual rectangular ranges in the RangeAreas object. If there are no used cells within the RangeAreas, the ItemNotFound error will be thrown.

[ API set: ExcelApi 1.9 ]

getUsedRangeAreas(valuesOnly?: boolean): Excel.RangeAreas;

Parameters

valuesOnly
boolean

Whether to only consider cells with values as used cells. Default is false.

Returns

getUsedRangeAreasOrNullObject(valuesOnly)

Returns the used RangeAreas that comprises all the used areas of individual rectangular ranges in the RangeAreas object. If there are no used cells within the RangeAreas, a null object will be returned.

[ API set: ExcelApi 1.9 ]

getUsedRangeAreasOrNullObject(valuesOnly?: boolean): Excel.RangeAreas;

Parameters

valuesOnly
boolean

Whether to only consider cells with values as used cells.

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?: Excel.Interfaces.RangeAreasLoadOptions): Excel.RangeAreas;

Parameters

Returns

Remarks

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

load(option?: string | string[]): Excel.RangeAreas - Where option is a comma-delimited string or an array of strings that specify the properties to load.

load(option?: { select?: string; expand?: string; }): Excel.RangeAreas - 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.RangeAreas - 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.

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

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

Parameters

propertyNamesAndPaths
{ select?: string; expand?: string; }

Where 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.RangeAreasUpdateData, options?: OfficeExtension.UpdateOptions): void;

Parameters

properties
Interfaces.RangeAreasUpdateData

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

Remarks

This method has the following additional signature:

set(properties: Excel.RangeAreas): void

set(properties)

Sets multiple properties on the object at the same time, based on an existing loaded object.

set(properties: Excel.RangeAreas): void;

Parameters

properties
Excel.RangeAreas

Returns

void

setDirty()

Sets the RangeAreas to be recalculated when the next recalculation occurs.

[ API set: ExcelApi 1.9 ]

setDirty(): void;

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.RangeAreas object is an API object, the toJSON method returns a plain JavaScript object (typed as Excel.Interfaces.RangeAreasData) that contains shallow copies of any loaded child properties from the original object.

toJSON(): Excel.Interfaces.RangeAreasData;

Returns

track()

Track the object for automatic adjustment based on surrounding changes in the document. This call is a shorthand for context.trackedObjects.add(thisObject). If you are using this object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created.

track(): Excel.RangeAreas;

Returns

untrack()

Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect.

untrack(): Excel.RangeAreas;

Returns