Excel.FunctionResult class

包含函数求值操作的结果的对象An object containing the result of a function-evaluation operation

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

Extends

属性

context

与该对象关联的请求上下文。The request context associated with the object. 这会将加载项的进程连接到 Office 主机应用程序的进程。This connects the add-in's process to the Office host application's process.

error

表示错误的错误值 (#如 "DIV/0")。Error value (such as "#DIV/0") representing the error. 如果未设置错误字符串, 则函数成功, 并将其结果写入值字段。If the error string is not set, then the function succeeded, and its result is written to the Value field. 该错误始终位于英语区域设置中。The error is always in the English locale.

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

value

函数计算的值。The value of function evaluation. 仅当未发生错误 (即, 未设置 error 属性) 时, 才会填充 "值" 字段。The value field will be populated only if no error has occurred (i.e., the Error property is not set).

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

方法

load(option)

将命令加入队列以加载对象的指定属性。Queues up a command to load the specified properties of the object. 在读取属性之前,你必须调用“context.sync()”。You must call "context.sync()" before reading the properties.

load(option)
load(option)
toJSON()

重写 JavaScript toJSON()方法, 以便在将 API 对象传递到时提供更有用的输出JSON.stringify()Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify反过来, 也会调用传递toJSON给它的对象的方法。尽管原始 FunctionResult对象是 API 对象, 但toJSON方法返回一个无格式的 JavaScript 对象 (类型为Interfaces.FunctionResultData<T>, in turn, calls the toJSON method of the object that is passed to it.) Whereas the original FunctionResult object is an API object, the toJSON method returns a plain JavaScript object (typed as Interfaces.FunctionResultData<T>), 其中包含原始对象中所有已加载的子属性的浅表副本。) that contains shallow copies of any loaded child properties from the original object.

属性详细信息

context

与该对象关联的请求上下文。The request context associated with the object. 这会将加载项的进程连接到 Office 主机应用程序的进程。This connects the add-in's process to the Office host application's process.

context: RequestContext;

属性值

RequestContext

error

表示错误的错误值 (#如 "DIV/0")。Error value (such as "#DIV/0") representing the error. 如果未设置错误字符串, 则函数成功, 并将其结果写入值字段。If the error string is not set, then the function succeeded, and its result is written to the Value field. 该错误始终位于英语区域设置中。The error is always in the English locale.

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

readonly error: string;

属性值

string

value

函数计算的值。The value of function evaluation. 仅当未发生错误 (即, 未设置 error 属性) 时, 才会填充 "值" 字段。The value field will be populated only if no error has occurred (i.e., the Error property is not set).

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

readonly value: T;

属性值

T

方法详细信息

load(option)

将命令加入队列以加载对象的指定属性。Queues up a command to load the specified properties of the object. 在读取属性之前,你必须调用“context.sync()”。You must call "context.sync()" before reading the properties.

load(option?: Excel.Interfaces.FunctionResultLoadOptions): FunctionResult<T>;

参数

返回

FunctionResult<T>

注解

除了此签名之外, 此方法还具有以下签名:In addition to this signature, this method has the following signatures:

load(option?: string | string[]): FunctionResult<T>-Where 选项是一个逗号分隔的字符串或一个字符串数组, 用于指定要加载的属性。load(option?: string | string[]): FunctionResult<T> - Where option is a comma-delimited string or an array of strings that specify the properties to load.

load(option?: { select?: string; expand?: string; }): FunctionResult<T>-Where 选项。选择是一个用逗号分隔的字符串, 用于指定要加载的属性和选项。 expand 是一个用逗号分隔的字符串, 用于指定要加载的导航属性。load(option?: { select?: string; expand?: string; }): FunctionResult<T> - 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 }): FunctionResult<T>-仅适用于集合类型。load(option?: { select?: string; expand?: string; top?: number; skip?: number }): FunctionResult<T> - Only available on collection types. 它类似于前面的签名。It is similar to the preceding signature. top 指定结果中可包含的集合项的最大数量。Option.top specifies the maximum number of collection items that can be included in the result. 选项。 skip 指定要跳过且不包含在结果中的项目数。Option.skip specifies the number of items that are to be skipped and not included in the result. 如果指定了 top 选项, 则在跳过指定数目的项目后将启动结果集。If option.top is specified, the result set will start after skipping the specified number of items.

load(option)

load(option?: string | string[]): FunctionResult<T>;

参数

option
string | string[]

返回

FunctionResult<T>

load(option)

load(option?: {
            select?: string;
            expand?: string;
        }): FunctionResult<T>;

参数

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

返回

FunctionResult<T>

toJSON()

重写 JavaScript toJSON()方法, 以便在将 API 对象传递到时提供更有用的输出JSON.stringify()Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify反过来, 也会调用传递toJSON给它的对象的方法。尽管原始 FunctionResult对象是 API 对象, 但toJSON方法返回一个无格式的 JavaScript 对象 (类型为Interfaces.FunctionResultData<T>, in turn, calls the toJSON method of the object that is passed to it.) Whereas the original FunctionResult object is an API object, the toJSON method returns a plain JavaScript object (typed as Interfaces.FunctionResultData<T>), 其中包含原始对象中所有已加载的子属性的浅表副本。) that contains shallow copies of any loaded child properties from the original object.

toJSON(): Interfaces.FunctionResultData<T>;

返回

Interfaces.FunctionResultData<T>