title: Access Not Configured. The API (Drive API) is not enabled for your project. Please use the Google Developers Console to update your configuration
body: <p>I got a bit of a problem.</p>
  
  <p>i created a googlesheet and included a script, like this, to send it as a pdf to my email address:</p>
  
  <pre><code>function onOpen() {
    var ui = SpreadsheetApp.getUi();
    // Or DocumentApp or FormApp.
    ui.createMenu('Custom Menu')
    .addItem('Send summary', 'menuItem1')
    .addSeparator()      
    .addItem('Send summary&amp;Week', 'menuItem2')
    .addToUi();
  }
  
  function menuItem1() {
  
  var source   = SpreadsheetApp.getActiveSpreadsheet();
  var subject  = source.getSheets()[9].getRange('G1').getValue(); //cell for              subject in sheet
  var body     = source.getSheets()[9].getRange('F1').getValue(); 
  var sheetNumSummary = 9; // first sheet(tab) is zero, second sheet is 1, etc..
  
  var source = SpreadsheetApp.getActiveSpreadsheet();
  var thema = source.getSheets()[9].getRange('f3').getValue();  // 
  var mailTo = ('youremailaddress@here.com'); //source.getSheets()        [0].getRange('D1').getValue(); // 'D1' cell which consists an emailaddress.
  var name = source.getSheets()[9].getRange('G1').getValue(); // Name of              Attachement
  var sheets = source.getSheets();
  sheets.forEach(function (s, i) {
      if (i !== sheetNumSummary) s.hideSheet();
  });
  var url = Drive.Files.get(source.getId())
      .exportLinks['application/pdf'];
  url = url + '&amp;size=letter' + //paper size
      '&amp;portrait=false' + //orientation, false for landscape
      '&amp;fitw=true' + //fit to width, false for actual size
      '&amp;sheetnames=false&amp;printtitle=false&amp;pagenumbers=false' + //hide optional
      '&amp;gridlines=false' + //false = hide gridlines
      '&amp;fzr=false'; //do not repeat row headers (frozen rows) on each page
  var token = ScriptApp.getOAuthToken();
  var response = UrlFetchApp.fetch(url, {
      headers: {
          'Authorization': 'Bearer ' + token
      }
  </code></pre>
  
  <p>now comes the weird thing. I'm able to use it with the Google sheet i used it with, but if i do a copy of it and use the script from the menue i get the message: </p>
  
  <p>Access Not Configured. The API (Drive API) is not enabled for your project. Please use the Google Developers Console to update your configuration. </p>
  
  <p>I checked everything in the admin and developer console, but couldn't find anything. I also activate: </p>
  
  <p>Two-legged OAuth access control  Allow access to all APIs
  The key and secret above are able to access any user's data for all Google Data APIs. Learn more</p>
  
  <p>If i leave the copy of the 1st sheet and deactivate the API access, the 1st sheet (the origin) doesn't work anymore with the script and i get the above alert message. I have to delete the copy, reactivate the API access to make it work again. So, somehow i guess, the copy is working with the a script that only allows to work with one Project Sheet and not with the copy of that sheet. Is there somehow a way to make it work? Or, how can i add/attach the script to the copy. I used this script:
      function getSpreadsheetKey() {
      return SpreadsheetApp.getActiveSpreadsheet().getId();
      };</p>
  
  <p>and saw that it gives me the google key from the original sheet. that might be the reason why i cant use the script with the copy of the google sheet. But i still don't know how wire it correctly.</p>