Obsolete
Status Update
Comments
mi...@google.com <mi...@google.com> #3
Hello there,
Thank you for reporting this! However, it seems that this is the expected behavior as the method will return the valid named ranges. Would you be interested in turning this into a feature request instead? If yes, how would it impact your organization in terms of costs and productivity?
ka...@gmail.com <ka...@gmail.com> #4
Sure, please make it a feature request. It would be useful for automating the maintenance of named ranges across a large number of sheets, which is what I was trying to implement 3 years ago when I logged this issue. I don't know how much time is spent manually checking and fixing corrupted named ranges, but certainly some amount each week.
Description
A short description of the request:
I would like to propose to add new type in
changeType
of the event object of OnChange event trigger, when the function of event trigger is executed by the OnChange event trigger.What is the purpose of this new feature?
Flow for replicating the issue.
At first, it prepares the following sample script. In this case, this script is put to the container-bound script of Spreadsheet.
Install the function of "onChange" as the installable OnChange event trigger.
When
=sample()
is put to a cell on Spreadsheet, when=sample()
is replaced with the script ofonChange
, the OnChange event trigger is fired. By this, the infinite loop of the event trigger occurs.changeType
. In the current stage, there are EDIT, INSERT_ROW, INSERT_COLUMN, REMOVE_ROW, REMOVE_COLUMN, INSERT_GRID, REMOVE_GRID, FORMAT, or OTHER. In this case,changeType
isOTHER
. But,OTHER
includes several changes. For example, it's that the sheet name is changed.Proposal
In this proposal, when
onChange
is executed by the OnChange event trigger, when the event trigger is executed by the script, ifchangeType
returns likeSCRIPT
, the infinite loop can be easily avoided.In the current workaround, I used the following sample script.
Reference