When setting dataValidation to a whole number between -x and y with a script, x and y can be 9999, but not anything bigger than 99999. I would have expected it to be integer min and max for excel. For 64-bit OS that should be quite large. This also impacts Excel javascript API. Setting it with the Excel UI works fine.
function main(workbook: ExcelScript.Workbook) {
const sheet = workbook.getActiveWorksheet();
const range = sheet.getCell(2, 16);
range.getDataValidation().setErrorAlert({
title: 'Invalid Data',
message: 'The value must be a decimal number',
style: ExcelScript.DataValidationAlertStyle.stop,
showAlert: true,
});
range.getDataValidation().setRule({
wholeNumber: {
formula1: "0",
formula2: "99999",
operator: ExcelScript.DataValidationOperator.between,
},
});
}
When setting dataValidation to a whole number between -x and y with a script, x and y can be 9999, but not anything bigger than 99999. I would have expected it to be integer min and max for excel. For 64-bit OS that should be quite large. This also impacts Excel javascript API. Setting it with the Excel UI works fine.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.