title: How do I set the last sheet in a spreadsheet as active sheet using SpreadsheetApp.openById()?
body: <p>How do I set the last sheet in my spreadsheet to the active sheet? This code isn't working. Not sure what I'm doing wrong...       </p>
  
  <pre><code>    var logbook = SpreadsheetApp.openById("my key code");
  
      var totalSheets = logbook.getNumSheets();
      var lastSheet = logbook.getSheets[totalSheets];
      var currentSheet = logbook.setActiveSheet(lastSheet);
  </code></pre>
  
  <p>I'm getting an error: </p>
  
  <blockquote>
    <p>Can not find method setActiveSheet</p>
  </blockquote>