title: Script fails on SpreadsheetApp.openById - Requires permission
body: <p>I have an onOpen function that creates a custom menu in a spreadsheet.  It's been working fine for over a year, but a couple days ago it stopped working.</p>
  
  <p>When I look at the execution transcript I get:</p>
  
  <p>"Execution failed: You do not have permission to call SpreadsheetApp.openById. Required permissions: <a href="https://www.googleapis.com/auth/spreadsheets" rel="nofollow noreferrer">https://www.googleapis.com/auth/spreadsheets</a>"</p>
  
  <p>This fails/relates to the below line of code:</p>
  
  <pre><code>var ss = SpreadsheetApp.openById("myID")
  </code></pre>
  
  <p>I've checked what API's are enabled, and I have Sheets enabled, which is reflected in the .json file.  I don't have @OnlyCurrentDoc anywhere in the script.  I've reset the permissions on the account for this script, ran the function again and allowed permissions, but still the menu will not create on open.</p>
  
  <p>My .json file:</p>
  
  <pre><code>{
  "timeZone": "Europe/London",
  "dependencies": {
  "enabledAdvancedServices": [{
    "userSymbol": "Sheets",
    "serviceId": "sheets",
    "version": "v4"
   }]
  },
  "exceptionLogging": "STACKDRIVER"
  }
  </code></pre>