Excel.CellValueType enum

表示对象的 CellValue 类型。

注解

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();
});

字段

array = "Array"

代表一个 ArrayCellValue.

boolean = "Boolean"

代表一个 BooleanCellValue.

double = "Double"

代表一个 DoubleCellValue.

empty = "Empty"

代表一个 EmptyCellValue.

entity = "Entity"

代表一个 EntityCellValue.

error = "Error"

代表一个 ErrorCellValue.

externalCodeServiceObject = "ExternalCodeServiceObject"

代表一个 ExternalCodeServiceObjectCellValue.

formattedNumber = "FormattedNumber"

代表一个 FormattedNumberCellValue.

function = "Function"

代表一个 FunctionCellValue.

linkedEntity = "LinkedEntity"

代表一个 LinkedEntityCellValue.

localImage = "LocalImage"

代表一个 LocalImageCellValue.

notAvailable = "NotAvailable"

代表一个 ValueTypeNotAvailableCellValue.

reference = "Reference"

代表一个 ReferenceCellValue.

string = "String"

代表一个 StringCellValue.

webImage = "WebImage"

代表一个 WebImageCellValue.