Edit

Excel.ArrayCellValue interface

Represents a 2D array of cell values.

Remarks

API set: ExcelApi 1.16

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

basicType

Represents the value that would be returned by Range.valueTypes for a cell with this value.

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.

elements

Represents the elements of the array. May not directly contain an ArrayCellValue.

referencedValues

Represents the cell values which are referenced within ArrayCellValue.elements.

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

API set: ExcelApi 1.16

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

API set: ExcelApi 1.16

elements

Represents the elements of the array. May not directly contain an ArrayCellValue.

elements: CellValue[][];

Property Value

Remarks

API set: ExcelApi 1.16

referencedValues

Represents the cell values which are referenced within ArrayCellValue.elements.

referencedValues?: ReferencedValue[];

Property Value

Remarks

API set: ExcelApi 1.16

type

Represents the type of this cell value.

type: CellValueType.array | ReferenceValueType.array | "Array";

Property Value

array | array | "Array"

Remarks

API set: ExcelApi 1.16