Excel.ValueTypeNotAvailableCellValue interface

シリアル化できない値の型を含むセルの値を表します。 たとえば、#UNKNOWN! このバージョンの Excel では認識されないリッチ値の種類を表すエラー。

注釈

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

// Read the fallback properties of a value that Excel can't serialize.
await Excel.run(async (context) => {
  const sheet: Excel.Worksheet = context.workbook.worksheets.getItem("Sample");
  const range: Excel.Range = sheet.getRange("B1");
  range.load("valuesAsJson");
  await context.sync();

  const cellValue: Excel.CellValue = range.valuesAsJson[0][0];
  if (cellValue.type === Excel.CellValueType.notAvailable) {
    const unavailableValue: Excel.ValueTypeNotAvailableCellValue = cellValue;
    console.log("B1 value type:", unavailableValue.type);
    console.log("B1 fallback type:", unavailableValue.basicType);
    console.log("B1 fallback value:", unavailableValue.basicValue);
  } else {
    console.log("B1 value type:", cellValue.type);
    console.log("B1's value type is supported. No unavailable-type fallback was returned.");
  }
});

プロパティ

basicType

この値を持つセルに対して Range.valueTypes によって返される値を表します。

basicValue

この値を持つセルに対して Range.values によって返される値を表します。

type

このセル値の型を表します。

プロパティの詳細

basicType

この値を持つセルに対して Range.valueTypes によって返される値を表します。

basicType: RangeValueType | "Boolean" | "Double" | "Error" | "Empty" | "String";

プロパティ値

Excel.RangeValueType | "Boolean" | "Double" | "Error" | "Empty" | "String"

注釈

API セット: ExcelApi 1.16

basicValue

この値を持つセルに対して Range.values によって返される値を表します。

basicValue: boolean | number | string;

プロパティ値

boolean | number | string

注釈

API セット: ExcelApi 1.16

type

このセル値の型を表します。

type: CellValueType.notAvailable | "NotAvailable";

プロパティ値

notAvailable | "NotAvailable"

注釈

API セット: ExcelApi 1.16