How to tell when recalculate is done in Calc?
I need to take action recalculate of a sheet is done.
The action can’t be done while calculating is taking place because it modifies a formula on the sheet.
When I try and modify a formula while recalculating is taking place it leads to LibreOffice crashing totally.
What I am trying to accomplish
I have a custom calc formula that set a formula array based upon a named range in the sheet.
In short my custom formula is aware when the named range data changes.
When the range data changes my custom formula updates the data in the formula array.
So far so good.
The issue is when data is added to the named range my formula recognizes the new data.
However, trying to set the formula array (array size has changed) to match the new data totally fails while recalculation is taking place, to the point that LibeOffice crashes.
I can update the formula array manually (by running my update code in APSO Console) and it works fine, but can’t update while recalculation is taking place.
My choices seem to be:
- Stop the recalculation and make the changes … I don’t think it is possible to stop recalculation
- Wait for recalculation to be done and then trigger the updates (this makes the most sense)
I do know how to determine when a recalculation has finished. Is this Possible?
Sheets have a Formulas Calculated
event but it fires before recalculation and not after.
I am working with python if it matters.
What I am trying to accomplish is very similar to this clip for excel.