Excel.CellValueType enum
Represents the types of the CellValue
object.
// 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" | Represents an |
boolean = "Boolean" | Represents a |
double = "Double" | Represents a |
empty = "Empty" | Represents an |
entity = "Entity" | Represents an |
error = "Error" | Represents an |
externalCodeServiceObject = "ExternalCodeServiceObject" | Represents an |
formattedNumber = "FormattedNumber" | Represents a |
linkedEntity = "LinkedEntity" | Represents a |
localImage = "LocalImage" | Represents a |
notAvailable = "NotAvailable" | Represents a |
reference = "Reference" | Represents a |
string = "String" | Represents a |
webImage = "WebImage" | Represents a |
Office Add-ins feedback
Office Add-ins is an open source project. Select a link to provide feedback: