Bug 137147 - Provide a way to cancel formula calculation in Calc (e.g., by hitting ESC key)
Summary: Provide a way to cancel formula calculation in Calc (e.g., by hitting ESC key)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calculate cancel-long-operations
  Show dependency treegraph
 
Reported: 2020-09-30 06:36 UTC by Kevin Suo
Modified: 2024-04-25 02:41 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screencast in Win10 with Excel 2019 (1.77 MB, video/webm)
2021-03-22 03:22 UTC, Kevin Suo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Suo 2020-09-30 06:36:41 UTC
The main functionality of Calc is to do complex spreadsheet calculations. Some spreadsheet formulas may take a lot of time to run in case the data source is large. Although the recent version of LibreOffice enabled Threaded Calculation, there are still cases when the calculation hangs.

As a result, we should provide a way to let the user decide when to cancel / terminate the calculation process. Otherwise, the only way to stop the calculation is to kill the process, which will cause dataloss.

Microsoft Excel already has this functionality, at least in its MSO 2010 version.

Steps to Reproduce:

1. Set complex formulas (vlookup, offset, match, sumifs...) in Calc with large dataset.

2. Hit ESC key (or other defined keys) should terminate the calculation. Already calculated results may be kept "as-is", or cleared.
Comment 1 m_a_riosv 2020-10-02 17:30:00 UTC
Meanwhile, you can disable Menu/Data/Calculate/Autocalculate.
Comment 2 Xisco Faulí 2020-11-18 14:44:11 UTC
as an enhancement, it makes sense, not sure whether it will ever be implemented though
Comment 3 s5t1e3v4e3m11@hotmail.com 2021-03-21 16:38:09 UTC
(In reply to Kevin Suo from comment #0)
> Microsoft Excel already has this functionality, at least in its MSO 2010
> version.

I have no MS Excel, can you please confirm some detail I am curious about?

Assume we have sat through a long formula fill of e.g. 60000 rows.
Then we change the formula on the top, double click the fill handle to change all already calculated cells to the new formula, but half-way through hit the designated calculation cancel button (e.g. ESC).

Is the result that half the cells have changed and the other half is unchanged or is Excel doing a ROLLBACK?

If this is implemented in LO, I would prefer to get a dialog asking what to do:
(1)just abort the calculation and leave the mixed data
(2)clear the remaining cells
(3)ROLLBACK
(4)continue

TBH, I am not sure (2) is really useful, but it is easy to find how far it got.

If I intentionally tried to cancel the calculation, I most likely realized that the formula was still not right and want the fastest way getting a responsive spreadsheet again, which probably would be (1)
Comment 4 Kevin Suo 2021-03-22 03:21:33 UTC
(In reply to s5t1e3v4e3m11@hotmail.com from comment #3)
I prepared a excel file with the following contents:

Sheet1:
ID        Value1        Value2    Value3    Value4    Value5
1              1             2         3         4         5
2              2             3         4         5         6
3              3             4         5         6         7
...
890361    890361        890362    890363    890364    890365

Sheet2:
ID        Value5
1              =vlookup(A1, Sheet1.A:F, 6,0)
2
3
...
890361

Then I fill down the formula in Sheet2 and immediately hit ESC.

In Excel, after I hit ESC, it immediately stopped the fill operation, but it for the cells which were already filled with formula the calculation goes on.

Also, I noticed that when I click the save icon, during the save process I have an option of hitting ESC to cancel.

Actually, what the ESC do seems to be related to what task is to be canceled, see: https://docs.microsoft.com/en-us/office/vba/api/Excel.Application.EnableCancelKey
Comment 5 Kevin Suo 2021-03-22 03:22:12 UTC
Created attachment 170616 [details]
Screencast in Win10 with Excel 2019