question

GianlucaBisceglie-9698 avatar image
0 Votes"
GianlucaBisceglie-9698 asked GianlucaBisceglie-9698 commented

Disable autosave via Excel office.js addin

Our Addin performs thousand of cell changes in a loop.

The problem is that Excel autosave, especially in Excel 365, kicks in at every cell change and becomes the bottleneck.

We could not find ways to disable autosave from office.js API.

Any suggestions on how to work around it?

Thanks.

office-addins-devoffice-js-dev
· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for reporting this issue, You mentioned that autosave kicks in every cell change, would you please share with us what are the content in your workbook? I would like to learn more about the issue you met.

0 Votes 0 ·

Hi @RaymondLu-2947

The workbook is an ordinary workbook with 1 input cell and anoutput cell.

For example, let A1 be 2 and let B1 be = 2*A1

If you have a JS addin that needs to change A1 and capture the value of B1, you will see that Excel365 will autosave at every recalculation.

Now imagine what happens if the addin changes 1 thousand values in A1 in a loop. Excel freezes and you can see "Saving..." forever. Saving, creating versions and updating UI at every recalculation kills the performance of the addin.

Excel desktop does not autosave at every recalculation but it is important for the addin to disable and re-enable autosave and UI updates before and after the algorithm runs.

0 Votes 0 ·

The workbook is an ordinary workbook with one input cell and one output cell.

For example, let A1 be 2 and let B1 be = 2*A1

If you have a JS addin that changes A1 and pushes the value of B1 to an array, you will see that Excel365 will autosave at every recalculation.

Now imagine what happens when the addin changes 1 thousand values in A1 in a loop. Excel freezes and you can see "Saving..." forever. Saving, creating versions and updating UI at every recalculation kills the performance of the addin. Like for VSTO, also office.js should allow to talk to the object model to avoid performance bottlenecks.

Excel desktop does not autosave at every recalculation but it is important for the addin to disable and re-enable autosave and UI updates before and after the algorithm runs.

0 Votes 0 ·
RaymondLu-2947 avatar image RaymondLu-2947 GianlucaBisceglie-9698 ·

There is a chance to suspend the calculation, would you please try the following 2 APIs?

  suspendApiCalculationUntilNextSync()
  suspendScreenUpdatingUntilNextSync()


The document can be found at
https://docs.microsoft.com/en-us/javascript/api/excel/excel.application?view=excel-js-preview#suspendApiCalculationUntilNextSync__

https://docs.microsoft.com/en-us/javascript/api/excel/excel.application?view=excel-js-preview#suspendScreenUpdatingUntilNextSync__

0 Votes 0 ·
Show more comments

0 Answers