我正在开发一个Excel加载项,我使用dialogApi进行身份验证。当我调用displayDialogAsync时,回调函数不会执行。
Office.context.ui.displayDialogAsync(url, { height: _height, width: _width}, dialogCallback)
var dialogCallback = function(asyncResult) {
if (asyncResult.status == "failed") {
// In addition to general system errors, there are 3 specific errors for
// displayDialogAsync that you can handle individually.
switch (asyncResult.error.code) {
case 12004:
jQuery("body").append("Domain is not trusted");
break;
case 12005:
jQuery("body").append("HTTPS is required");
break;
case 12007:
jQuery("body").append("A dialog is already opened.");
break;
default:
jQuery("body").append(asyncResult.error.message);
break;
}
}else{
jQuery("body").append("Success");
dialog = asyncResult.value;
dialog.addEventHandler(Office.EventType.DialogMessageReceived, messageHandler);
}
}
以上代码在Windows和Mac OS中运行良好,但在iPad的情况下不执行回调。 我正在使用Excel 1.25(160603)
-Thanks
答案 0 :(得分:1)
如果升级到最近的Excel版本,则此错误应该消失。