title: insertRowsBefore() Method causing error: cannot convert (range) to class
body: <p>I was trying to write a script in google spreadsheets that, will read a range from a defined cell, take its value and <code>Insert</code> as many rows as the range would indicate, and then copy and paste an specific range also given by a range value in a cell.</p>
  
  <p>Apparently the copy and paste range value works, but the range value for the <code>insertRowsBefore</code> is unable to convert the range value, any idea why this happens? I get this error</p>
  
  <blockquote>
    <p>cannot convert (range) to class</p>
  </blockquote>
  
  <p>here is how the scripts looks like:</p>
  
  <pre><code>function CopyActualvsWMS() {    
    var ss = SpreadsheetApp.getActiveSpreadsheet();    
    var sheet = ss.getSheetByName("ActualVsSystem");
    var value0 = sheet.getRange('T4');   
    var r1 = value0.getValue();    
    var insert =ss.getSheetByName("DataBase").insertRowBefore(r1);    
    var value1 = sheet.getRange('T3');    
    var cr1 = value1.getValue();    
    var source = ss.getRange(cr1);    
    source.copyTo(ss.getRange("DataBase!a2"), {contentsOnly: true});
  }
  </code></pre>