exceloffice-jscustom-functions-excel

Excel JavaScript custom function starting twice after loading spreadsheet?


After loading a spreadsheet that contains a cell with a custom function reference, the custom function appears to be loaded twice. Can this be avoided?

To reproduce the issue for Excel Desktop:

  1. Create a folder and run yo office --projectType excel-functions --name 'TestAddin' --host excel --js

  2. Change to folder TestAddIn and run npm run build, then npm start

  3. Allow some time for the plugin to compile and Excel to start, then select a spreadsheet cell and type =CONTOSO.INCREMENT(1) into the Excel formula bar. Press Enter.

  4. You should now see the cell showing incrementing values.

  5. Save the spreadsheet and close Excel.

  6. Re-open the spreadsheet.

Over time, the cell shows:

#BUSY
1
2
3
#BUSY
1
2
3
4
...

Note that this is not using the shared runtime. A similar issue is logged here: https://github.com/OfficeDev/office-js/issues/847.


Solution

  • This particular issue seems to be related to running the example under the debugger, see: https://github.com/OfficeDev/office-js/issues/1714