Google Sheet Script server error on getNamedRanges()
While writing a Google Apps Script for Google Sheets to delete Named Ranges that have been orphaned by deleting the target they reference, an unexpected "server error" occurred. Can someone please tell me how to avoid it? EDIT: Please note that in addition to solving the attached demonstration script, I seek a general solution for every time the routine SpreadsheetApp.getNamedRanges() is called. I will deploy a command to remove orphaned range names from any Google Spreadsheet. It will be part of the NamedRanges routines in dlbTools which is already available in the Google Add-ons Store at