Conditional formatting for “Loading…” cells

2019-09-07 02:27发布

问题:

Is there some way to underline or apply a conditional formatting for cells waiting to be calculated?

Or, however, is there a way to know if a cell is "Loading..." in a script?

回答1:

No, neither conditional formatting nor scripts are aware of the "Loading..." condition of a cell. When a script attempts to access the value of a cell being calculated, the script's execution is paused until that calculation finishes. I tested this on an artificially slow custom function:

function slow(a) {
  Utilities.sleep(20000);
  return 2*a;
}

Entering =slow(22) and then invoking a script with getValue() on that cell results in the script running for a long time, until the function finishes and the script receives 44 as the cell's value.