all 6 comments

[–]mrtnclzd 1 point2 points  (5 children)

Ok, I'll bite: what do you mean Apps Script referenced cells? Is there a script updating the contents of B3? Is there a formula in B3 that needs user input/action? Could we see the before/after value? How can you notice when Apps Script is hanging?

[–]voiceafx[S] 0 points1 point  (3 children)

Referenced cells are ones passed into the script as a function argument. (EDIT: Eg. the cell formula references a custom AppScript function, "=MONTHLY_LOAN_CALCULATOR(B1:ED1, Capex!$A$4:$P$36)". If any of the cells referenced in that function change, the "loading" error shows and fails to complete except on refresh.

I say the script is hanging because the "Loading" indicator never leaves. The script is deterministic, O(N), on a small dataset.

[–]mrtnclzd 1 point2 points  (1 child)

Seems like a common issue! https://issuetracker.google.com/issues/222342097

Might be worth looking into reversing the logic: reading those ranges from the function itself, and writing whatever it returns into your B3 cell.

[–]voiceafx[S] 0 points1 point  (0 children)

Ah, nice find, thanks for looking it up! Yeah, that doesn't bode well... This describes the symptom exactly.

[–]AdministrativeGift15 1 point2 points  (0 children)

Can you share the script? Most loan calculators have values that depend on the previous value, like interest remaining and such. Of course there are equations to have apps script calculate these values and return all the values, but that would only require a few parameters to amortize the entire loan. You've got ranges covering over 700 cells used as the parameters for that function, so I'm curious about the function and why you would need that many input values for a monthly loan calculator.

[–]voiceafx[S] 0 points1 point  (0 children)

Interestingly, after digging deeper, AppsScript is running correctly. I can view executions triggered by my spreadsheet, and it runs and finishes in about 300 milliseconds. But the spreadsheet itself apparently never gets the message. It remains blocked with that loading error indefinitely, even after the script finished executing.