Excel.ErrorCellValueType enum

表示对象的 ErrorCellValue 类型。

注解

API 集:ExcelApi 1.16

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/20-data-types/data-types-error-values.yaml

// This function sets the value of cell A1 to a #BUSY! error using data types.
await Excel.run(async (context) => {
  // Retrieve the Sample worksheet and cell A1 on that sheet.
  const sheet = context.workbook.worksheets.getItemOrNullObject("Sample");
  const range = sheet.getRange("A1");

  // Get the error data type and set its type to `busy`.
  const error: Excel.ErrorCellValue = {
    type: Excel.CellValueType.error,
    errorType: Excel.ErrorCellValueType.busy
  };

  // Set cell A1 as the busy error.
  range.valuesAsJson = [[error]];
  await context.sync();
});

字段

blocked = "Blocked"

代表一个 BlockedErrorCellValue.

busy = "Busy"

代表一个 BusyErrorCellValue.

calc = "Calc"

代表一个 CalcErrorCellValue.

connect = "Connect"

代表一个 ConnectErrorCellValue.

div0 = "Div0"

代表一个 Div0ErrorCellValue.

external = "External"

代表一个 ExternalErrorCellValue.

field = "Field"

代表一个 FieldErrorCellValue.

gettingData = "GettingData"

代表一个 GettingDataErrorCellValue.

name = "Name"

代表一个 NameErrorCellValue.

notAvailable = "NotAvailable"

代表一个 NotAvailableErrorCellValue.

null = "Null"

代表一个 NullErrorCellValue.

num = "Num"

代表一个 NumErrorCellValue.

placeholder = "Placeholder"

代表一个 PlaceholderErrorCellValue.

python = "Python"

代表一个 PythonErrorCellValue.

ref = "Ref"

代表一个 RefErrorCellValue.

spill = "Spill"

代表一个 SpillErrorCellValue.

timeout = "Timeout"

代表一个 TimeoutErrorCellValue.

value = "Value"

代表一个 ValueErrorCellValue.