title: Error Sheet not found in Google Sheets Script
body: <p>I made this code in a google sheet script and worked fine, but for some reason all the sudden it shows the error &quot;Sheet not found&quot; but nothing has changed, the sheets have the same name as when I tried the funtion before and the values are not empty, the sheet USRdb DO exist:</p>
  <pre><code>function LastRowNumber(){
  
  var SheetToMeassure = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(&quot;USRdb&quot;); 
  var RangeToMeassure = SheetToMeassure.getRange(&quot;A1:A&quot;).getValues();
  var LastRow = RangeToMeassure.filter(String).length;
  
  
  var ui = SpreadsheetApp.getUi();
  
  ui.alert(&quot;Number of the last row: &quot; + LastRow);
  
  }
  </code></pre>
  <p>The error shown:</p>
  <pre><code>12:56:37 PM Error   
  Exception: Sheet 400456734 not found
  LastRowNumber   @ Code.gs:55
  </code></pre>
  <p><strong>Where it says Code.gs:55 is referring to the line that starts with</strong> <em>&quot;var hojaa = SpreadsheetApp.getActiveSpreadsheet().&quot;</em></p>