Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validation valid wholeNumber range is too small #295

Open
duane-j-wagner opened this issue Oct 6, 2023 · 4 comments
Open

validation valid wholeNumber range is too small #295

duane-j-wagner opened this issue Oct 6, 2023 · 4 comments
Assignees
Labels
Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown Type: product bug Bug in the Office Scripts platform or Office Scripts APIs

Comments

@duane-j-wagner
Copy link

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.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Oct 6, 2023
@duane-j-wagner
Copy link
Author

duane-j-wagner commented Oct 6, 2023

Looks like there is already a similar bug against the code. The document should mention any restrictions in how values can be set. I've seen some examples with quoted numbers and some without quotes. Does it matter?
OfficeDev/office-js#3088

@ElizabethSamuel-MSFT ElizabethSamuel-MSFT added Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Oct 6, 2023
@ElizabethSamuel-MSFT
Copy link
Collaborator

@duane-j-wagner Thanks for raising this issue.

@AlexJerabek Can you take a look?

Thanks.

@AlexJerabek
Copy link
Collaborator

Hi, @duane-j-wagner

Sorry for the delay. I was trying to get some internal traction. The information you linked to in the office-js bug is correct: the range is currently 0-65535.

@AlexJerabek AlexJerabek added Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown Type: product bug Bug in the Office Scripts platform or Office Scripts APIs and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Oct 13, 2023
@AlexJerabek
Copy link
Collaborator

Internal tracking number 8009234.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown Type: product bug Bug in the Office Scripts platform or Office Scripts APIs
Projects
None yet
Development

No branches or pull requests

3 participants