0

实际问题:

从 Windows 获取最新更新后,我们收到 Office.js 的“等待上一个调用完成”错误(api 方法:Office.context.document.bindings.addFromNamedItemAsync)。

大多数使用此最新更新的用户都面临这个问题。(对于 oder 版本,它运行良好)

目前,我们从 USER 机器中删除了 Windows 更新,并卸载并重新安装了 MS Office。

以下是我们的观察结果: 当要编写的名称范围很大时,我们会看到这一点。这仅在最新更新后发生。在看到之前,具有相同名称范围编号的相同代码曾经可以正常工作。

即使在执行以下步骤之后,修改的文件也不会反映在 JS 文件的任务窗格应用程序中(但能够看到 html 更改,不确定这是一个新的更新问题) - 构建项目以生成 JS 文件(来自 Type 脚本)。- 直接修改JS文件。- 删除了 IE 浏览器缓存。- 清理解决方案并再次重建 - 删除临时文件 - 系统重新启动。

无法将调试器脚本进程附加到 Visual Studio(它与其他系统一起工作正常)。

这是我们面临此问题的版本信息:

在此处输入图像描述

在此处输入图像描述

如果您需要更多信息,请告诉我。

更新了1个解释 `

Office.select('bindings#' + namedRange, function (callback: any) {

                if (callback.status === Office.AsyncResultStatus.Failed) {
                    Office.context.document.bindings.addFromNamedItemAsync(
                        namedRange, //The name of the named item. Required.
                        bindingType, // Specifies the type of the binding object to create. Required.
                        {
                            id: namedRange, // Specifies the unique name to be used to identify the binding object. Optional. If no id argument is passed, an id will be autogenerated.
                            //asyncContext: data, // A user-defined item of any type that is returned in the AsyncResult object without being altered. Optional.
                            coercionType: bindingType
                        },
                        // A function that is invoked when the callback returns, whose only parameter is of type AsyncResult. 
                        (result: any) => {
                            if (result.status == Office.AsyncResultStatus.Succeeded) {
                                var id = result.value.id;

                                Office.select(
                                    "bindings#" + id,
                                    function onError() {
                                        defQ.reject('  Error: Binding not found');
                                    }
                                ).getDataAsync(
                                    {
                                    },
                                    (asyncResult: any) => {
                                        if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {
                                            tracer.Trace("Completed read operation In ReadExcelQPromise method " + namedRange + " time elapsed -" + (Date.now() - startTime));
                                            defQ.resolve(asyncResult.value);
                                        }
                                        else {
                                            tracer.Trace("In ReadExcelQPromiseFail1 method " + namedRange + Date() + " ", asyncResult);
                                            defQ.reject('  Error: ' + asyncResult.error.message);
                                        }
                                    }
                                    );
                            }
                            else {
                                tracer.Trace("In ReadExcelQPromiseFail2 method " + namedRange + " " + Date(), result);
                                defQ.reject('  Error: ' + result.error.message);
                            }
                        });
                }
            }).getDataAsync(
                {
                },
                (asyncResult: any) => {
                    if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {
                        tracer.Trace("Completed read operation In ReadExcelQPromise method " + namedRange + " time elapsed -" + (Date.now() - startTime));
                        defQ.resolve(asyncResult.value);
                    }
                    else {
                        tracer.Trace("In ReadExcelQPromiseFail3 method " + namedRange + " " + Date(), asyncResult);
                        defQ.reject('Error: ' + asyncResult.error.message);
                    }
                }
                );

确切消息是:在 WriteExcelQPromiseFail3 方法中 FRWK_Base_GroupLK_MXTue 2019 年 4 月 23 日 23:55:06 GMT+0530(印度标准时间)

错误:等到上一个调用完成

4

0 回答 0