title: How to delete all NamedRanges in google spreadsheet
body: <p>I have a lot of named ranges in my spreadsheet and time to time I need to delete all of them and create new one. In past I did this by deleting worksheet but recently I've discovered that this operation is not deleting named ranges. So Ive tried to use Class NamedRanges and list trough them by name on second row and to remove them one by one but it doesn't work here is what I tried:</p>
  
  <pre><code>function CellNamerRemove()
  {
  // the purpose of the CellNamerRemove function is to automatically remove all range names the complete vertical CellRanges
  // for each column that has a 'header' in the sheet called 'RawData'. The Quality purpose is to force
  // Named-Links only to exist in referencing the raw data from the Starccm+ files
  
  // get a reference to the RawData Spreadsheet
      var thisSheetString = "RawData";
      var maxRows = SpreadsheetApp.getActiveSheet().getMaxRows();
      var lastColumn = SpreadsheetApp.getActiveSheet().getLastColumn();
  
  // loop from 1st column ie 1 to lastColumn. 
        for(thisColumn = 1; thisColumn &lt;= lastColumn;thisColumn++)
            {
                var thisName  =   SpreadsheetApp.getActiveSpreadsheet().getSheetByName(thisSheetString).getRange(2, thisColumn, 1, 1).getValue();
                var ss = SpreadsheetApp.getActiveSpreadsheet();
                // ss.setNamedRange(trim(thisName), thisRange);
               ss.getRangeByName(thisName).remove();
           }
  }
  </code></pre>
  
  <p>Can you help me with?</p>