title: How to access data on different Google Spreadsheet through Google Apps Script?
body: <p>I'm writing a Google Apps Script on my Google Site and am trying to use data that is provides on 2 different tabs in a Google Spreadsheet. From what I thought I understood from the documentation I could use all available methods in the <code>SpreadsheetApp</code> class on a Sites script by just using the <code>openById()</code> method. </p>
  
  <p>Anyway here is what I tried to do</p>
  
  <pre><code>function doGet(e) {
  
      var doc = SpreadsheetApp.openById(SPREADSHEET_ID_GOES_HERE).getActiveSheet();
      SpreadsheetApp.setActiveSheet(doc.getSheetId()[1]);
  
      //....
  }
  </code></pre>
  
  <p>I get the error </p>
  
  <blockquote>
    <p>Cannot find method setActiveSheet(. (line 4)</p>
  </blockquote>
  
  <p>I'm pulling my work off this link: <a href="https://developers.google.com/apps-script/storing_data_spreadsheets" rel="noreferrer">Storing Data in Google Spreadsheets</a> and also the Ui Service section listed under Building User Interfaces.</p>
  
  <p>Anybody seeing what I'm doing wrong in these two lines?</p>