数据使用 office.js 在桌面 Excel 上呈现,但在 Chrome Office 365 上它给出错误“处理请求时出错". [英] Data get render on Desktop Excel using office.js, but on Chrome Office 365 its give an error "There was an error processing the request."

查看:71
本文介绍了数据使用 office.js 在桌面 Excel 上呈现,但在 Chrome Office 365 上它给出错误“处理请求时出错".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用 Office js 库在 excel 上呈现数据.有超过 2000 行可以在 桌面 Excel 上正常运行.但是,当在 Chrome office 365 上使用相同的 API 时,它会给出错误消息处理请求时出错".

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."

请看附件截图.

随着数据变大,Chrome Office excel 无法呈现数据.请帮助我们,因为这是我们应用程序中的拦截器,我们的生产正在受到影响.

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.

推荐答案

在构建 Excel 加载项时与 Excel 工作簿交互有 2 个限制

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

  • Web 上的 Excel 对请求和响应的负载大小有限制5MB.如果超过该限制,将引发 RichAPI.Error.
  • 获取操作的范围限制为 500 万个单元格.

根据您的描述,我认为您遇到了有效载荷大小问题.我建议在调用 context.sync() 之前检查数据.根据需要将操作拆分为更小的部分.请务必为每个子操作调用 context.sync() 以避免这些操作再次批处理.

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.

另一个技巧是利用 RangeAreas 策略性地更新更大范围内的单元格.请参阅使用 multiple在 Excel 加载项中同时进行范围以获取更多信息.

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.

这篇关于数据使用 office.js 在桌面 Excel 上呈现,但在 Chrome Office 365 上它给出错误“处理请求时出错".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆