title: Google Apps Script Error "Exception: Invalid argument: options. Should be of type: Map"
body: <p>I'm trying to make a quick script to copy information from a series of spreadsheets into a single spreadsheet. I'm getting an error</p>
  <blockquote>
  <p>&quot;Exception: Invalid argument: options. Should be of type: Map&quot;.</p>
  </blockquote>
  <p>I know very little about maps, and this error makes no sense to me.</p>
  <pre><code>function make_new_contact_lists() {
    DriveApp.getFileById(&quot;1IZBpDno4MOBeiGJeIKd2ykHpCr2359jhcV_SJpSuQ94&quot;);
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    SpreadsheetApp.setActiveSpreadsheet(ss);
    var sheet = ss.getSheetByName(&quot;Sheet2&quot;)
    ss.setActiveSheet(sheet);
    var lr = sheet.getLastRow();
    var range = sheet.getRange(&quot;A2:B&quot; + lr).getValues();
    var list = [];
    list.push([range]);
    for (i = 0; i &lt; list.length; i++) {
      var entry = list[i];
      var name = entry[0];
      var fileID = entry[1];
  
      var newsheet =
        SpreadsheetApp.openById(&quot;1IZBpDno4MOBeiGJeIKd2ykHpCr2359jhcV_SJpSuQ94&quot;);
      SpreadsheetApp.setActiveSpreadsheet(newsheet);
  
      /**--&gt;This is where the error gets flagged**/
      newsheet.insertSheet(name);
      var newsheet2 = newsheet.setActiveSheet(name);
  
      var file = SpreadsheetApp.getFileById(fileID);
      var spreadsheet = file.setActiveSpreadsheet();
      var current = spreadsheet.getSheetByName(&quot;Current Contacts&quot;);
      spreadsheet.setActiveSheet(current);
      var range2 = current.getRange(&quot;A1:G3&quot;).getValues();
      current.setValues
    }
  }
  </code></pre>
  <p>Thank you for any help you can provide</p>