3

I have made an Excel add-in, which pops up a window either by window.open or Dialog API.

I just tested it in Excel for Mac: when the window is opened, it seems that we can NOT put the focus back to Excel or the add-in taskpane; we have to close the window before choosing Excel or the add-in taskpane.

Does anyone know if there is a way to enable switching focus between popup window and Excel?

SoftTimur
  • 5,630
  • 38
  • 140
  • 292

2 Answers2

3

The dialog window is a modal in nature that forces the user to interact with it before they can go back to using the parent add-in/Office host. For interaction that requires back-n-forth with Excel, task-pane is the right place for UI.

Sudhi Ramamurthy
  • 2,358
  • 1
  • 10
  • 14
  • So do you confirm that in Excel for Mac we cannot back-n-forth the popup window (either by `window.open` or Dialog box) with Excel? It is still odd that the popup window doesn't have the same behaviour in Excel for Mac, for Windows and Online... – SoftTimur Jun 24 '17 at 22:58
  • Could you clarify what you mean by difference in Mac/Win/Online? – Sudhi Ramamurthy Jun 27 '17 at 06:33
  • In Win/Online we can switch between the popup window and Excel, whereas in Mac we cannot. – SoftTimur Jun 27 '17 at 07:00
0

The dialog API is meant to always show the dialog on top of other items. In terms of modality, you are correct that in Windows the dialog allows you to still interact with the spreadsheet while in other platforms, like Mac or Online is fully modal (cannot switch back to the spreadsheet). My recommendation is to design your add-in accounting for multi-platform so assume the dialog is modal in all platforms. As Sudhi recommends in his response, if your interaction requires the user to use the add-in and the spreadsheet back and forth, using a pane is a better model.

Humberto Lezama
  • 586
  • 2
  • 8
  • Correct, fogot to mention that it depends on the displayAsIframe flag, then it is also modal in online. – Humberto Lezama Jul 18 '17 at 20:58
  • So do you confirm that in Excel for Mac, there is no way to make spreadsheet back and forth no matter what the configuration (eg, the `displayInIframe` flag) is? It is very important for me... – SoftTimur Jul 24 '17 at 11:23