0

I was using the following function from Office js library to display a Excel dialog -

Office.context.ui.displayDialogAsync(startAddress, options, callback)

On closing the dialog box programatically and trying to open it again , it is showing the following error -

Error code - 12007 .A dialog box is already opened from the task pane. A task pane add-in can only have one dialog box open at a time.

The issue is persisting at Microsoft Excel 16.13. It works fine on all the previous versions of Excel.

Dee_wab
  • 1,171
  • 1
  • 10
  • 23
  • How are you closing it programmatically? – Marc LaFleur May 16 '18 at 14:25
  • @MarcLaFleur - I am using the following code - Office.context.ui.messageParent("Y"); The following event handler is also added to handle the message - var dialogWindow = asyncResult.value; dialog.addEventHandler(Microsoft.Office.WebExtension.EventType.DialogMessageReceived,function(asyncResult){ dialogWindow.close(); }); – Arupam Sengupta May 17 '18 at 06:52
  • The dialog window is also getting closed. But when we are executing the function the next time. The above mentioned error pops up. – Arupam Sengupta May 17 '18 at 06:53
  • It most likely has to do with context getting lost or references being left hanging around causing the dialog api to think there is still an active window. If you can edit your question and include snippets on how you're opening the API and wiring up the even handles, it will help narrow down what is happening. – Marc LaFleur May 17 '18 at 16:53
  • @MarcLaFleur - This is the sample code that we used - – Arupam Sengupta May 31 '18 at 11:07
  • declare var Office; declare var $; declare const Excel: any; //open dialog function openDialog= function(){ console.log("in open dialog function"); Office.context.ui.displayDialogAsync('https://localhost:4200', {height:20, width:20}, function(asyncResult){ console.log(asyncResult.value); } ); } – Arupam Sengupta May 31 '18 at 11:09
  • @MarcLaFleur - Any lead on this would be very helpful. – Arupam Sengupta Jun 07 '18 at 10:01

0 Answers0