title: ¿How can I make a copy of a SpreadSheet and name it after a Cell?
body: <p>Im in an active SpreadSheet and trying to make a copy of another inactive SpreadSheet and trying to name it after a cell from the active SpreadSheet.</p>
  <p>This is what im doing so far, but it gives me the following error: TypeError: Cannot read property 'getRange' of null. Can some one help me with this?</p>
  <pre><code>
  var originSS = SpreadsheetApp.getActiveSpreadsheet();
  var originSheet = originSS.getSheetByName(&quot;Sheet 1&quot;);
  var newName = originSheet.getRange(&quot;B2&quot;).getDisplayValue();
  
  var templateID = (&quot;1TpbQjOUszz3jJlKun0WxJAyL1X93xWK2AG29B_Pv5ko&quot;);
  var newSheet = SpreadsheetApp.openById(templateID).copy(newName);
  }```
  </code></pre>