Excel.ValueTypeNotAvailableCellValue interface
Represents the value of a cell containing a type of value which cannot be serialized. For example, an #UNKNOWN! error which represents a type of rich value not known to this version of Excel.
Remarks
Examples
// 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.");
}
});
Properties
| basic |
Represents the value that would be returned by |
| basic |
Represents the value that would be returned by |
| type | Represents the type of this cell value. |
Property Details
basicType
Represents the value that would be returned by Range.valueTypes for a cell with this value.
basicType: RangeValueType | "Boolean" | "Double" | "Error" | "Empty" | "String";
Property Value
Excel.RangeValueType | "Boolean" | "Double" | "Error" | "Empty" | "String"
Remarks
basicValue
Represents the value that would be returned by Range.values for a cell with this value.
basicValue: boolean | number | string;
Property Value
boolean | number | string
Remarks
type
Represents the type of this cell value.
type: CellValueType.notAvailable | "NotAvailable";
Property Value
notAvailable | "NotAvailable"