title: TypeError: Cannot read property 'getRange' of undefined
body: <p>Why AppScript in google sheets doesn't find the range in the sheet?The SpreadsheetApp finds the sheet but shows error in line 6.</p>
  <p>I tried ActiveRange and just getRange defining this in the sheet, but I always see this error.</p>
  <p>Please help me I'm not a programmer.</p>
  <p>Below is my function:</p>
  <pre><code>function sendEmailtoworkers() { 
      let ss = SpreadsheetApp.getActiveSpreadsheet();
      let sheet = ss.getSheetByName('number')[0];
      let list = sheet.getRange(2,2,9,2);
      MailApp.sendEmail( list, &quot;пупкин&quot;, &quot;Пожалуйста, зайди на этот файл: docs.google.com/spreadsheets/d/…);
  }
  </code></pre>