ReferredArea

ReferredArea class

Represents a referred area by the formula.

Properties

NameTypeDescription
IsExternalLinkbooleanIndicates whether this is an external link.
ExternalFileNameStringGet the external file name if this is an external reference.
SheetNameStringIndicates which sheet this reference is in.
SheetNamesString[]
IsEntireRowbooleanIndicates whether this area contains all columns(entire row).
IsEntireColumnbooleanIndicates whether this area contains all rows(entire column).
IsAreabooleanIndicates whether this is an area. If this is not an area, only StartRow and StartColumn effect.
EndColumnintThe end column of the area.
StartColumnintThe start column of the area.
EndRowintThe end row of the area.
StartRowintThe start row of the area.

Methods

NameDescription
getValuesGets cell values in this area.
getValueGets cell value with given offset from the top-left of this area.
toStringReturns the reference address of this area. Generally it is the address of the reference which may be used in formula, s

Indicates whether this is an external link.

Type: boolean

ReferredArea.ExternalFileName property

Get the external file name if this is an external reference.

Type: String

ReferredArea.SheetName property

Indicates which sheet this reference is in.

Type: String

ReferredArea.SheetNames property

Type: String[]

ReferredArea.IsEntireRow property

Indicates whether this area contains all columns(entire row).

Type: boolean

ReferredArea.IsEntireColumn property

Indicates whether this area contains all rows(entire column).

Type: boolean

ReferredArea.IsArea property

Indicates whether this is an area. If this is not an area, only StartRow and StartColumn effect.

Type: boolean

ReferredArea.EndColumn property

The end column of the area.

Type: int

ReferredArea.StartColumn property

The start column of the area.

Type: int

ReferredArea.EndRow property

The end row of the area.

Type: int

ReferredArea.StartRow property

The start row of the area.

Type: int

getValues() (1 of 2)

Gets cell values in this area.

Returns: If this area is invalid, “#REF!” will be returned; If this area is one single cell, then return the cell value object; Otherwise return one 2D array for all values in this area.


getValues(calculateFormulas) (2 of 2)

Gets cell values in this area.

ParameterTypeDescription
calculateFormulasbooleanIn this range, if there are some formulas that have not been calculated, this flag denotes whether those formulas should be calculated recursively

Returns: If this area is invalid, “#REF!” will be returned; If this area is one single cell, then return the cell value object; Otherwise return one 2D array for all values in this area.

getValue(rowOffset, colOffset) (1 of 2)

Gets cell value with given offset from the top-left of this area.

ParameterTypeDescription
rowOffsetintrow offset from the start row of this area
colOffsetintcolumn offset from the start row of this area

Returns: “#REF!” if this area is invalid; “#N/A” if given offset out of this area; Otherwise return the cell value at given position.


getValue(rowOffset, colOffset, calculateFormulas) (2 of 2)

Gets cell value with given offset from the top-left of this area.

ParameterTypeDescription
rowOffsetintrow offset from the start row of this area
colOffsetintcolumn offset from the start row of this area
calculateFormulasbooleanWhether calculate it recursively if the specified reference is formula

Returns: “#REF!” if this area is invalid; “#N/A” if given offset out of this area; Otherwise return the cell value at given position.

toString()

Returns the reference address of this area. Generally it is the address of the reference which may be used in formula, such as “Sheet1!A1:C3”.

Returns: the reference address of this area.