OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
677 stars 95 forks source link

Range.text returns null on some ranges on version 2407 #4783

Closed jroycroft closed 2 months ago

jroycroft commented 2 months ago

Provide required information needed to triage your issue

On a range of greater than 5 million cells, trying to get .text or .values returns null instead of an array of empty strings on version 2407. Version 2405 and below returns the expected values.

Your Environment

Expected behavior

API returns an array of values

Current behavior

API returns null

Steps to reproduce

  1. Create a sheet with a usedRange of greater than 5 million cells (as an example, A1:BZ64103)
  2. Try to access usedRange.text or usedRange.values
  3. Returns null

Link to live example(s)

ScriptLab example: https://gist.github.com/jroycroft/7d268cf8552db0294f1d7bebac422984

Provide additional details

This behaviour is different than on version 2405 and below of Excel, where these values would still be returned. On version 2407, we're getting null. I do see that there is documentation saying there's a cell limit https://learn.microsoft.com/en-us/office/dev/add-ins/concepts/resource-limits-and-performance-optimization#excel-add-ins so this may be expected behaviour, however this issue seems to only be occurring on the latest release version.

Context

Need to read values that users of our addin have entered on the sheet

Useful logs

Thank you for taking the time to report an issue. Our triage team will respond to you in less than 72 hours. Normally, response time is <10 hours Monday through Friday. We do not triage on weekends.

penglongzhaochina commented 2 months ago

Thanks for reporting this issue.

It has been put on our backlog<Bug#9258039> for internal track. We will keep track of this issue and let you know if there are any updates.

XuanZhouMSFT commented 2 months ago

Hi @jroycroft, thanks for the waiting. On all platforms, a range is limited to five million cells for get operations. The large range operation may result some bad behavior like hanging application, so we set the limitation for desktop also. Please refer to the document for some best practice: https://learn.microsoft.com/en-us/office/dev/add-ins/excel/performance#payload-size-limit-best-practices. Please let me know if you have other concerns.

microsoft-github-policy-service[bot] commented 2 months ago

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!

microsoft-github-policy-service[bot] commented 2 months ago

This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.