Excel.Interfaces.RangeData interface

描述通过调用 "toJSON ()" 返回的数据的接口。An interface describing the data returned by calling "range.toJSON()".

属性

address

表示 A1 样式的区域引用。Represents the range reference in A1-style. Address 值将包含工作表引用 (例如, "Sheet1!A1: B4 ")。Address value will contain the Sheet reference (e.g. "Sheet1!A1:B4"). 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

addressLocal

以用户语言表示对指定区域的区域引用。Represents range reference for the specified range in the language of the user. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

cellCount

范围中的单元格数。Number of cells in the range. 如果单元格数超过 2^31-1 (2,147,483,647),此 API 返回 -1。This API will return -1 if the cell count exceeds 2^31-1 (2,147,483,647). 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

columnCount

表示区域中的列总数。Represents the total number of columns in the range. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

columnHidden

表示当前 range 的所有列均已隐藏。Represents if all columns of the current range are hidden.

[API 集: ExcelApi 1.2][ API set: ExcelApi 1.2 ]

columnIndex

表示区域中第一个单元格的列编号。Represents the column number of the first cell in the range. 从零开始编制索引。Zero-indexed. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

conditionalFormats

与该范围相交的 ConditionalFormats 的集合。Collection of ConditionalFormats that intersect the range. 只读。Read-only.

[API 集: ExcelApi 1.6][ API set: ExcelApi 1.6 ]

dataValidation

返回数据有效性对象。Returns a data validation object.

[API 集: ExcelApi 1.8][ API set: ExcelApi 1.8 ]

format

返回一个格式对象,其中封装了区域的字体、填充、边框、对齐方式和其他属性。Returns a format object, encapsulating the range's font, fill, borders, alignment, and other properties. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

formulas

表示采用 A1 表示法的公式。Represents the formula in A1-style notation. 将公式设置为区域时, value 参数可以是单个值 (字符串), 也可以是二维数组。When setting formulas to a range, the value argument can be either a single value (a string) or a two-dimensional array. 如果参数是单个值, 它将应用于区域中的所有单元格。If the argument is a single value, it will be applied to all cells in the range.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

formulasLocal

表示采用 A1 样式表示法的公式,使用用户的语言和数字格式区域设置。Represents the formula in A1-style notation, in the user's language and number-formatting locale. 例如,英语中的公式 "=SUM(A1, 1.5)" 在德语中将变为 "=SUMME(A1; 1,5)"。For example, the English "=SUM(A1, 1.5)" formula would become "=SUMME(A1; 1,5)" in German. 将公式设置为区域时, value 参数可以是单个值 (字符串), 也可以是二维数组。When setting formulas to a range, the value argument can be either a single value (a string) or a two-dimensional array. 如果参数是单个值, 它将应用于区域中的所有单元格。If the argument is a single value, it will be applied to all cells in the range.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

formulasR1C1

表示采用 R1C1 表示法的公式。Represents the formula in R1C1-style notation. 将公式设置为区域时, value 参数可以是单个值 (字符串), 也可以是二维数组。When setting formulas to a range, the value argument can be either a single value (a string) or a two-dimensional array. 如果参数是单个值, 它将应用于区域中的所有单元格。If the argument is a single value, it will be applied to all cells in the range.

[API 集: ExcelApi 1.2][ API set: ExcelApi 1.2 ]

hasSpill

表示所有单元格是否都具有溢出边框。Represents if all cells have a spill border. 如果所有单元格都有溢出边框, 则返回 true; 如果所有单元格都没有溢出边框, 则返回 false。Returns true if all cells have a spill border, or false if all cells do not have a spill border. 如果区域中有和没有溢出边框的单元格, 则返回 null。Returns null if there are cells both with and without spill borders within the range.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

height

返回从区域的上边缘到区域的下边缘的 100% 缩放的距离(以磅为单位)。Returns the distance in points, for 100% zoom, from top edge of the range to bottom edge of the range. 只读。Read-only.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

hidden

表示当前区域中的所有单元格是否隐藏。Represents if all cells of the current range are hidden. 只读。Read-only.

[API 集: ExcelApi 1.2][ API set: ExcelApi 1.2 ]

hyperlink

表示当前区域的超链接。Represents the hyperlink for the current range.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

isEntireColumn

表示当前区域是否为整列。Represents if the current range is an entire column. 只读。Read-only.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

isEntireRow

表示当前区域是否为整行。Represents if the current range is an entire row. 只读。Read-only.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

left

返回从工作表的左边缘到区域的左边缘的 100% 缩放的距离(以磅为单位)。Returns the distance in points, for 100% zoom, from left edge of the worksheet to left edge of the range. 只读。Read-only.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

linkedDataTypeState

表示每个单元格的数据类型状态。Represents the data type state of each cell. 只读。Read-only.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

numberFormat

表示给定范围的 Excel 数字格式代码。Represents Excel's number format code for the given range. 将数字格式设置为一个区域时, value 参数可以是单个值 (string), 也可以是二维数组。When setting number format to a range, the value argument can be either a single value (string) or a two-dimensional array. 如果参数是单个值, 它将应用于区域中的所有单元格。If the argument is a single value, it will be applied to all cells in the range.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

numberFormatLocal

表示 Excel 中的给定区域的数字格式代码,以用户语言的字符串表示。Represents Excel's number format code for the given range as a string in the language of the user. 将数字格式设置为局部区域时, value 参数可以是单个值 (字符串), 也可以是二维数组。When setting number format local to a range, the value argument can be either a single value (string) or a two-dimensional array. 如果参数是单个值, 它将应用于区域中的所有单元格。If the argument is a single value, it will be applied to all cells in the range.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

rowCount

返回区域中的总行数。Returns the total number of rows in the range. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

rowHidden

表示当前 range 的所有行均已隐藏。Represents if all rows of the current range are hidden.

[API 集: ExcelApi 1.2][ API set: ExcelApi 1.2 ]

rowIndex

返回区域中第一个单元格的行编号。Returns the row number of the first cell in the range. 从零开始编制索引。Zero-indexed. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

savedAsArray

表示是否将所有单元格都保存为数组公式。Represents if ALL the cells would be saved as an array formula. 如果所有单元格都将保存为数组, 则返回 true; 如果所有单元格不保存为数组公式, 则返回 false。Returns true if ALL cells would be saved as an array, or false if ALL cells would NOT be saved as an array formula. 如果有混合的单元格, 且不能保存为数组公式, 则返回 null。Returns null if there is a mixture of cells that would and would not be saved as an array formula.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

style

表示当前区域的样式。Represents the style of the current range. 如果单元格的样式不一致, 则将返回 null。If the styles of the cells are inconsistent, null will be returned. 对于自定义样式, 将返回样式名称。For custom styles, the style name will be returned. 对于内置样式, 将返回一个表示 BuiltInStyle 枚举中的值的字符串。For built-in styles, a string representing a value in the BuiltInStyle enum will be returned.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

text

指定区域的文本值。Text values of the specified range. 文本值与单元格宽度无关。The Text value will not depend on the cell width. Excel # UI 中发生的符号替换不会影响 API 返回的文本值。The # sign substitution that happens in Excel UI will not affect the text value returned by the API. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

top

返回从工作表的上边缘到区域的上边缘的 100% 缩放的距离(以磅为单位)。Returns the distance in points, for 100% zoom, from top edge of the worksheet to top edge of the range. 只读。Read-only.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

values

表示指定区域的原始值。Represents the raw values of the specified range. 返回的数据可能是字符串、数字,也可能是布尔值。The data returned could be of type string, number, or a boolean. 包含错误的单元格将返回错误字符串。Cells that contain an error will return the error string. 将值设置为一个范围时, value 参数可以是单个值 (string、number 或 boolean), 也可以是一个二维数组。When setting values to a range, the value argument can be either a single value (string, number or boolean) or a two-dimensional array. 如果参数是单个值, 它将应用于区域中的所有单元格。If the argument is a single value, it will be applied to all cells in the range.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

valueTypes

表示每个单元格的数据类型。Represents the type of data of each cell. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

width

返回从区域的左边缘到区域的右边缘的 100% 缩放的距离(以磅为单位)。Returns the distance in points, for 100% zoom, from left edge of the range to right edge of the range. 只读。Read-only.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

属性详细信息

address

表示 A1 样式的区域引用。Represents the range reference in A1-style. Address 值将包含工作表引用 (例如, "Sheet1!A1: B4 ")。Address value will contain the Sheet reference (e.g. "Sheet1!A1:B4"). 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

address?: string;

属性值

string

addressLocal

以用户语言表示对指定区域的区域引用。Represents range reference for the specified range in the language of the user. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

addressLocal?: string;

属性值

string

cellCount

范围中的单元格数。Number of cells in the range. 如果单元格数超过 2^31-1 (2,147,483,647),此 API 返回 -1。This API will return -1 if the cell count exceeds 2^31-1 (2,147,483,647). 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

cellCount?: number;

属性值

number

columnCount

表示区域中的列总数。Represents the total number of columns in the range. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

columnCount?: number;

属性值

number

columnHidden

表示当前 range 的所有列均已隐藏。Represents if all columns of the current range are hidden.

[API 集: ExcelApi 1.2][ API set: ExcelApi 1.2 ]

columnHidden?: boolean;

属性值

boolean

columnIndex

表示区域中第一个单元格的列编号。Represents the column number of the first cell in the range. 从零开始编制索引。Zero-indexed. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

columnIndex?: number;

属性值

number

conditionalFormats

与该范围相交的 ConditionalFormats 的集合。Collection of ConditionalFormats that intersect the range. 只读。Read-only.

[API 集: ExcelApi 1.6][ API set: ExcelApi 1.6 ]

conditionalFormats?: Excel.Interfaces.ConditionalFormatData[];

属性值

Excel.Interfaces.ConditionalFormatData[]

dataValidation

返回数据有效性对象。Returns a data validation object.

[API 集: ExcelApi 1.8][ API set: ExcelApi 1.8 ]

dataValidation?: Excel.Interfaces.DataValidationData;

属性值

format

返回一个格式对象,其中封装了区域的字体、填充、边框、对齐方式和其他属性。Returns a format object, encapsulating the range's font, fill, borders, alignment, and other properties. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

format?: Excel.Interfaces.RangeFormatData;

属性值

formulas

表示采用 A1 表示法的公式。Represents the formula in A1-style notation. 将公式设置为区域时, value 参数可以是单个值 (字符串), 也可以是二维数组。When setting formulas to a range, the value argument can be either a single value (a string) or a two-dimensional array. 如果参数是单个值, 它将应用于区域中的所有单元格。If the argument is a single value, it will be applied to all cells in the range.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

formulas?: any[][];

属性值

any[][]

formulasLocal

表示采用 A1 样式表示法的公式,使用用户的语言和数字格式区域设置。Represents the formula in A1-style notation, in the user's language and number-formatting locale. 例如,英语中的公式 "=SUM(A1, 1.5)" 在德语中将变为 "=SUMME(A1; 1,5)"。For example, the English "=SUM(A1, 1.5)" formula would become "=SUMME(A1; 1,5)" in German. 将公式设置为区域时, value 参数可以是单个值 (字符串), 也可以是二维数组。When setting formulas to a range, the value argument can be either a single value (a string) or a two-dimensional array. 如果参数是单个值, 它将应用于区域中的所有单元格。If the argument is a single value, it will be applied to all cells in the range.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

formulasLocal?: any[][];

属性值

any[][]

formulasR1C1

表示采用 R1C1 表示法的公式。Represents the formula in R1C1-style notation. 将公式设置为区域时, value 参数可以是单个值 (字符串), 也可以是二维数组。When setting formulas to a range, the value argument can be either a single value (a string) or a two-dimensional array. 如果参数是单个值, 它将应用于区域中的所有单元格。If the argument is a single value, it will be applied to all cells in the range.

[API 集: ExcelApi 1.2][ API set: ExcelApi 1.2 ]

formulasR1C1?: any[][];

属性值

any[][]

hasSpill

备注

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

表示所有单元格是否都具有溢出边框。Represents if all cells have a spill border. 如果所有单元格都有溢出边框, 则返回 true; 如果所有单元格都没有溢出边框, 则返回 false。Returns true if all cells have a spill border, or false if all cells do not have a spill border. 如果区域中有和没有溢出边框的单元格, 则返回 null。Returns null if there are cells both with and without spill borders within the range.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

hasSpill?: boolean;

属性值

boolean

height

备注

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

返回从区域的上边缘到区域的下边缘的 100% 缩放的距离(以磅为单位)。Returns the distance in points, for 100% zoom, from top edge of the range to bottom edge of the range. 只读。Read-only.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

height?: number;

属性值

number

hidden

表示当前区域中的所有单元格是否隐藏。Represents if all cells of the current range are hidden. 只读。Read-only.

[API 集: ExcelApi 1.2][ API set: ExcelApi 1.2 ]

hidden?: boolean;

属性值

boolean

表示当前区域的超链接。Represents the hyperlink for the current range.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

hyperlink?: Excel.RangeHyperlink;

属性值

isEntireColumn

表示当前区域是否为整列。Represents if the current range is an entire column. 只读。Read-only.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

isEntireColumn?: boolean;

属性值

boolean

isEntireRow

表示当前区域是否为整行。Represents if the current range is an entire row. 只读。Read-only.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

isEntireRow?: boolean;

属性值

boolean

left

备注

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

返回从工作表的左边缘到区域的左边缘的 100% 缩放的距离(以磅为单位)。Returns the distance in points, for 100% zoom, from left edge of the worksheet to left edge of the range. 只读。Read-only.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

left?: number;

属性值

number

linkedDataTypeState

表示每个单元格的数据类型状态。Represents the data type state of each cell. 只读。Read-only.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

linkedDataTypeState?: Excel.LinkedDataTypeState[][];

属性值

Excel.LinkedDataTypeState[][]

numberFormat

表示给定范围的 Excel 数字格式代码。Represents Excel's number format code for the given range. 将数字格式设置为一个区域时, value 参数可以是单个值 (string), 也可以是二维数组。When setting number format to a range, the value argument can be either a single value (string) or a two-dimensional array. 如果参数是单个值, 它将应用于区域中的所有单元格。If the argument is a single value, it will be applied to all cells in the range.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

numberFormat?: any[][];

属性值

any[][]

numberFormatLocal

表示 Excel 中的给定区域的数字格式代码,以用户语言的字符串表示。Represents Excel's number format code for the given range as a string in the language of the user. 将数字格式设置为局部区域时, value 参数可以是单个值 (字符串), 也可以是二维数组。When setting number format local to a range, the value argument can be either a single value (string) or a two-dimensional array. 如果参数是单个值, 它将应用于区域中的所有单元格。If the argument is a single value, it will be applied to all cells in the range.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

numberFormatLocal?: any[][];

属性值

any[][]

rowCount

返回区域中的总行数。Returns the total number of rows in the range. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

rowCount?: number;

属性值

number

rowHidden

表示当前 range 的所有行均已隐藏。Represents if all rows of the current range are hidden.

[API 集: ExcelApi 1.2][ API set: ExcelApi 1.2 ]

rowHidden?: boolean;

属性值

boolean

rowIndex

返回区域中第一个单元格的行编号。Returns the row number of the first cell in the range. 从零开始编制索引。Zero-indexed. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

rowIndex?: number;

属性值

number

savedAsArray

备注

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

表示是否将所有单元格都保存为数组公式。Represents if ALL the cells would be saved as an array formula. 如果所有单元格都将保存为数组, 则返回 true; 如果所有单元格不保存为数组公式, 则返回 false。Returns true if ALL cells would be saved as an array, or false if ALL cells would NOT be saved as an array formula. 如果有混合的单元格, 且不能保存为数组公式, 则返回 null。Returns null if there is a mixture of cells that would and would not be saved as an array formula.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

savedAsArray?: boolean;

属性值

boolean

style

表示当前区域的样式。Represents the style of the current range. 如果单元格的样式不一致, 则将返回 null。If the styles of the cells are inconsistent, null will be returned. 对于自定义样式, 将返回样式名称。For custom styles, the style name will be returned. 对于内置样式, 将返回一个表示 BuiltInStyle 枚举中的值的字符串。For built-in styles, a string representing a value in the BuiltInStyle enum will be returned.

[API 集: ExcelApi 1.7][ API set: ExcelApi 1.7 ]

style?: string;

属性值

string

text

指定区域的文本值。Text values of the specified range. 文本值与单元格宽度无关。The Text value will not depend on the cell width. Excel # UI 中发生的符号替换不会影响 API 返回的文本值。The # sign substitution that happens in Excel UI will not affect the text value returned by the API. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

text?: string[][];

属性值

string[][]

top

备注

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

返回从工作表的上边缘到区域的上边缘的 100% 缩放的距离(以磅为单位)。Returns the distance in points, for 100% zoom, from top edge of the worksheet to top edge of the range. 只读。Read-only.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

top?: number;

属性值

number

values

表示指定区域的原始值。Represents the raw values of the specified range. 返回的数据可能是字符串、数字,也可能是布尔值。The data returned could be of type string, number, or a boolean. 包含错误的单元格将返回错误字符串。Cells that contain an error will return the error string. 将值设置为一个范围时, value 参数可以是单个值 (string、number 或 boolean), 也可以是一个二维数组。When setting values to a range, the value argument can be either a single value (string, number or boolean) or a two-dimensional array. 如果参数是单个值, 它将应用于区域中的所有单元格。If the argument is a single value, it will be applied to all cells in the range.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

values?: any[][];

属性值

any[][]

valueTypes

表示每个单元格的数据类型。Represents the type of data of each cell. 只读。Read-only.

[API 集: ExcelApi 1.1][ API set: ExcelApi 1.1 ]

valueTypes?: Excel.RangeValueType[][];

属性值

Excel.RangeValueType[][]

width

备注

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

返回从区域的左边缘到区域的右边缘的 100% 缩放的距离(以磅为单位)。Returns the distance in points, for 100% zoom, from left edge of the range to right edge of the range. 只读。Read-only.

[API 集: EXCELAPI BETA (仅限预览)][ API set: ExcelApi BETA (PREVIEW ONLY) ]

width?: number;

属性值

number