Excel.ArrayCellValue interface
Represents a 2D array of cell values.
Remarks
Examples
const sheet = context.workbook.worksheets.getActiveWorksheet();
// This `EntityCellValue` contains an `ArrayCellValue` with two products and their prices.
const myEntity: Excel.EntityCellValue = {
type: Excel.CellValueType.entity,
text: "Product Catalog",
properties: {
items: {
type: Excel.CellValueType.array, /* ArrayCellValue */
elements: [[
{
type: Excel.CellValueType.string,
basicValue: "Bicycle"
},
{
type: Excel.CellValueType.double,
basicValue: 300,
numberFormat: "$* #,##0.00",
}
],
[
{
type: Excel.CellValueType.string,
basicValue: "Helmet"
},
{
type: Excel.CellValueType.double,
basicValue: 25,
numberFormat: "$* #,##0.00",
}
]],
basicType: Excel.RangeValueType.error,
basicValue: "#VALUE!"
}
},
basicType: Excel.RangeValueType.error, // A read-only property. Used as a fallback in incompatible scenarios.
basicValue: "#VALUE!" // A read-only property. Used as a fallback in incompatible scenarios.
};
sheet.getCell(0,0).valuesAsJson = [[myEntity]];
Properties
| basic |
Represents the value that would be returned by |
| basic |
Represents the value that would be returned by |
| elements | Represents the elements of the array. May not directly contain an |
| referenced |
Represents the cell values which are referenced within |
| 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.error | "Error";
Property Value
error | "Error"
Remarks
basicValue
Represents the value that would be returned by Range.values for a cell with this value. When accessed through a valuesAsJson property, this string value aligns with the en-US locale. When accessed through a valuesAsJsonLocal property, this string value aligns with the user's display locale.
basicValue?: "#VALUE!" | string;
Property Value
"#VALUE!" | string
Remarks
elements
Represents the elements of the array. May not directly contain an ArrayCellValue.
elements: CellValue[][];
Property Value
Excel.CellValue[][]
Remarks
referencedValues
Represents the cell values which are referenced within ArrayCellValue.elements.
referencedValues?: ReferencedValue[];
Property Value
Remarks
type
Represents the type of this cell value.
type: CellValueType.array | ReferenceValueType.array | "Array";