title: Issue w/ get.Range() of null
body: <p>I'm having trouble with the following code where I keep getting an error message</p>
  <blockquote>
  <p>Cannot read property 'getRange' of null.</p>
  </blockquote>
  <p>The error message appears when executing the code line:</p>
  <pre><code>var vs=dbsh.getRange(2,1,dbsh.getLastRow()-1,25).getValues();
  </code></pre>
  <p>Can anyone help on this issue?</p>
  <pre><code>function M*******o() {
   Run_M*****9();
   Run_2****C();
   Run_M****0();
   AddForm();
  }
  
    
  function Run_M*****9() {
    var ss = SpreadsheetApp.openById(&quot;File ID&quot;); /* Final Consolidation File */
    const sk = ss.getSheetByName('Config'); /* Access worksheet CONFIG */
    var cc = sk.getRange(&quot;D5&quot;).getValue();  /* Access file ID in worksheet CONFIG */
    const sh = ss.getSheetByName('Manual'); /* Destination worksheet in final consolidation file */
    sh.getRange(2,1,sh.getLastRow(),30).clearContent(); /* Clear content in the Destination WS */
    var dbss=SpreadsheetApp.openById(cc); /* Access origin using range in var cc*/
    const dbsh=dbss.getSheetByName('Database'); /* Access origin WS */
    var vs=dbsh.getRange(2,1,dbsh.getLastRow()-1,25).getValues(); /* Paste Values */
    var ff=sh.getRange(2,1,dbsh.getLastRow()-1,25).setValues(vs);   
  }  
  
  function R*****C() {
    var ss = SpreadsheetApp.openById(&quot;&quot;File ID&quot;&quot;); /* Final Consolidation File */
    const sk = ss.getSheetByName('Config'); /* Access worksheet CONFIG */
    var cc = sk.getRange(&quot;D7&quot;).getValue();  /* Access range in worksheet CONFIG */
    const sh = ss.getSheetByName('Manual'); /* Destination worksheet in final consolidation file */
    var dbss=SpreadsheetApp.openById(cc); /* Access origin using range in var cc*/
    const dbsh=dbss.getSheetByName('Database'); /* Access origin WS */
    var vs=dbsh.getRange(2,1,dbsh.getLastRow()-1,25).getValues(); /* Paste Values */
    var ff=sh.getRange(sh.getLastRow()+1,1,dbsh.getLastRow()-1,25).setValues(vs); 
  }  
  
  function R********0() {
    var ss = SpreadsheetApp.openById(&quot;File ID&quot;); /* Final Consolidation File */
    const sk = ss.getSheetByName('Config'); /* Access worksheet CONFIG */
    var cc = sk.getRange(&quot;D6&quot;).getValue();  /* Access range in worksheet CONFIG */
    const sh = ss.getSheetByName('Manual'); /* Destination worksheet in final consolidation file */
    var dbss=SpreadsheetApp.openById(cc); /* Access origin using range in var cc*/
    const dbsh=dbss.getSheetByName('Database'); /* Access origin WS */
    var vs=dbsh.getRange(2,1,dbsh.getLastRow()-1,25).getValues(); /* Paste Values */
    var ff=sh.getRange(sh.getLastRow()+1,1,dbsh.getLastRow()-1,25).setValues(vs); 
  }   
  </code></pre>