Excel.ErrorCellValue type
Représente une valeur de cellule qui contient une erreur.
export type ErrorCellValue = BlockedErrorCellValue | BusyErrorCellValue | CalcErrorCellValue | ConnectErrorCellValue | Div0ErrorCellValue | ExternalErrorCellValue | FieldErrorCellValue | GettingDataErrorCellValue | NotAvailableErrorCellValue | NameErrorCellValue | NullErrorCellValue | NumErrorCellValue | PlaceholderErrorCellValue | PythonErrorCellValue | RefErrorCellValue | SpillErrorCellValue | TimeoutErrorCellValue | ValueErrorCellValue;
Remarques
[ Ensemble d’API : ExcelApi 1.16 ]
Pour en savoir plus sur les types de cet alias de type, consultez les liens suivants.
Excel.BlockedErrorCellValue, Excel.BusyErrorCellValue, Excel.CalcErrorCellValue, Excel.ConnectErrorCellValue, Excel.Div0ErrorCellValue, Excel.ExternalErrorCellValue, Excel.FieldErrorCellValue, Excel.GettingDataErrorCellValue, Excel.NotAvailableErrorCellValue, Excel.NameErrorCellValue, Excel.NullErrorCellValue, Excel.NumErrorCellValue, Excel.NumErrorCellValue, Excel.PlaceholderErrorCellValue, Excel.PythonErrorCellValue, Excel.RefErrorCellValue, Excel.SpillErrorCellValue, Excel.TimeoutErrorCellValue, Excel.ValueErrorCellValue
Exemples
// 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();
});