2
votes

We are using Office js library to render data on excel. There are more than 2000 rows that works fine on Desktop Excel. But when same API is used on Chrome office 365 it gives error message "There was an error processing the request."

Please see attached screenshot.

enter image description here

As data get larger Chrome Office excel is not able to render data. Please help us as this is blocker in our application and our production is getting effected.

1
I guess you are hitting payload size limit, what's the size for a single row?Raymond Lu
I am receiving like below response object format in Ajax call. {"resultRow":[{"Date":"2019-05-01T05:00:00.000+0000","Class of ":"0","Account ID (FA)":"123","Account":"ABC","Account2":"PQR"} ...] And having around 2000 of rows in resultRow array. Each row object contains around 4-6 columns. Same trying to render on excel using Excel.run function of Office js. @RaymondLuSameer Shaikh
Can you try to split the operation and see if you still hit the error?Raymond Lu

1 Answers

1
votes

There are 2 limitations when interacting with Excel workbook When you're building an Excel add-in

  • Excel on the web has a payload size limit for requests and responses of 5MB. RichAPI.Error will be thrown if that limit is exceeded.
  • A range is limited to five million cells for get operations.

Based on your description, it looks to me that you are hitting payload size issue. I would suggest to check the data before calling context.sync(). Split the operation into smaller pieces as needed. Be sure to call context.sync() for each sub-operation to avoid those operations getting batched together again.

Another tip is to leverage RangeAreas to strategically update cells within a larger range. See Work with multiple ranges simultaneously in Excel add-ins for more information.