Excel JavaScript API 无法读取工作表边缘与 IE 的范围



我们有一个Excel加载项,它将范围写入Excel工作表并允许用户对其进行修改。完成后,他们将按下一个按钮,我们将在该按钮上从工作表中读取范围并尝试解析它。

Excel最近更新了其集成浏览器: https://learn.microsoft.com/en-us/office/dev/add-ins/concepts/browsers-used-by-office-web-add-ins

视窗 10 版本 <1903/Office 365
Internet Explorer 11

Windows 10 版本>= 1903/Office 365 版本 <16.0.11629
Internet Explorer 11

Windows 10 版本>= 1903/Office 365 版本>= 16.0.11629
Microsoft Edge*

我们追踪了这种基于边缘的实现的问题,并为此制作了一个代码示例。

当我们加载范围从 A1:A100 的 excel 工作表和随机字符串(每个 80 个字符(时,我们无法从工作表加载范围。 即版本中的任务窗格确实点击了注释,但在边缘它不会被击中。

我们尝试使用以下代码加载范围:

// Run a batch operation against the Excel object model
Excel.run(function (ctx) {
// Create a proxy object for the used range and load its properties    
var sourceRange = ctx.workbook.worksheets.getActiveWorksheet().getUsedRange().load("values, rowCount, columnCount");
// Run the queued-up command, and return a promise to indicate task completion
return ctx.sync()
.then(function () {
// Unhit code in edge only ????              
})
.then(ctx.sync);
})
.catch(errorHandler);

这是Officejs中的一个错误。 它已被修复,并可在 10-09-2019 上作为 Office 预览体验成员构建

https://github.com/OfficeDev/office-js/issues/697

最新更新