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

linkedEntity = "LinkedEntity"

表示 LinkedEntityCellValue

localImage = "LocalImage"

表示 LocalImageCellValue

notAvailable = "NotAvailable"

表示 ValueTypeNotAvailableCellValue

reference = "Reference"

表示 ReferenceCellValue

string = "String"

表示 StringCellValue

webImage = "WebImage"

表示 WebImageCellValue