Skip to content

validation valid wholeNumber range is too small #295

@duane-j-wagner

Description

@duane-j-wagner

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,
      },
    });

}

Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

Labels

Status: in backlogIssue is being tracked in the backlog but timeline for resolution is unknownType: product bugBug in the Office Scripts platform or Office Scripts APIs

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions