Reputation: 5510
I am making an Excel add-in by Excel JavaScript API. There is a button in this add-in, clicking on it launches popup = window.open("https://localhost:3000/#/new/", "popup", "width=1000, height=1100")
and popups a browser window.
Closing the workbook or the add-in will NOT systematically close the popup. So at the moment, if I open a workbook and the add-in again, and click on the button, another browser window will popup.
I am thinking if it is possible to always use the same popup for all the excel/add-in instances. We could use localstorage
to share information among different excel/add-in instances, but I am not sure if it is possible to save the popup/window there.
Does anyone have any good idea to achieve this?
Upvotes: 1
Views: 68
Reputation: 33094
For Office Add-ins, you should be using the built in Dialog API. This API ensures popups are properly handled regardless of platform (i.e. across browsers, mobile and desktop clients).
The Dialog object supports a close
method, allowing you to close any open dialogs from the parent taskpane.
Upvotes: 1