1

Meet strange problem with Excel addin. Having two parallel sessions in a single file on SharePoint and Addin activated in both:

in the first session, the addin recreates (deletes and then adds) the worksheet, then creates a table there and fills it with data. at the 'add rows' step the addin in second session disappears without any errors reported in the console.

With javascript console, breakpoints and some 'await context.sync();' we found, that recreating worksheet, adding table and defining table headers passes normally, but after 'table.rows.add(0 , data['data']);' the addin in second session disappears.

found no keys to solve this issue. I.e. disabling events in the second session doesn`t help. This behavior is a big problem, because when addin disappears - all registered events stop to work too (shared javascript runtime is enabled).

how this behavior could be explained and fixed?

Reproducing is simple: open same doc on two pages, then activate script lab in both (no matter if script itself is executed or not). Then click 'Run' at the executed one. Here is the gist: https://gist.github.com/ASamSam/ad3c7717988628d6a361018205cef0ea

after clicking the button in executed script - script lab in second page will disappear. If several addons (our own in my eample) activated - all will disappear

  • You may have found a bug. Please use the [Script Lab tool](https://learn.microsoft.com/en-us/office/dev/add-ins/overview/explore-with-script-lab) to reproduce the behavior and export a gist. Then provide a link to the gist. Also, are you working in Excel on the web or Excel Desktop. If the latter, is it on Windows or on Mac? – Rick Kirkham Mar 31 '21 at 20:10
  • It is on Windows. Thanks for the proposal, did manage to reproduce with Script Lab. reproducong is simple: open same excel document with two pages in Chrome. activate Script Lab on both pages. then add such code in standard example – Andrew Samokish Apr 15 '21 at 17:58
  • Great progress.Please export the Script Lab snippet to a gist in the Script Lab UI and paste a link to it in your question. – Rick Kirkham Apr 15 '21 at 18:01
  • Reproducing is simple: open same doc on two pages, then activate script lab in both. Here is the gist repared by my frend:[link](https://gist.github.com/dmishin/0ca3ace1f50869a505921f213cb1a1b6) after clicking the button in executed script - script lab in second page will disappear. If several addons (our own in my eample) activated - all will disappear – Andrew Samokish Apr 15 '21 at 18:21
  • The file you linked to is not a properly created gist, so it does not run. See the section [Save and share snippets](https://learn.microsoft.com/en-us/office/dev/add-ins/overview/explore-with-script-lab#save-and-share-snippets) for how to properly export a public gist. – Rick Kirkham Apr 15 '21 at 19:11
  • Thank you for the reference. hope now it is created properly – Andrew Samokish Apr 16 '21 at 08:00
  • I can reproduce this in **Excel on the web**, but not on desktop Excel. It can also happen when both browsers are Edge or one is Edge and the other is Chrome. I think you should create a bug for the [office-js repo](https://github.com/OfficeDev/office-js/issues/new?template=bug_report.md). Be sure to specify that you are working in **Excel on the web** and include the link to your gist. Also, be sure that you are following all the best practices described in [Coauthoring in Excel Add-ins](https://learn.microsoft.com/en-us/office/dev/add-ins/excel/co-authoring-in-excel-add-ins). – Rick Kirkham Apr 16 '21 at 20:09
  • Thank you very much, did add the bug https://github.com/OfficeDev/office-js/issues/1803 – Andrew Samokish Apr 18 '21 at 09:33

1 Answers1

0

The issue has been tracked in enter link description here

Rita
  • 72
  • 3