title: Google apps script, openByURL returns missing file?
body: <p>I've been trying to figure out why part of my Google App script doesn't work, but I've failed to come up with an answer.</p>
  
  <p>The script is downloading an attachment, CSV, from an email in Gmail and stores in with a specific name in a specific folder - this works perfectly fine.</p>
  
  <p>But then I want to edit the CSV, and this is where I run into problems.</p>
  
  <pre><code>    var newFolderIterator = DriveApp.getFoldersByName(destinationFolderName)
      var newFolderId, myFileName, myFileId
      while(newFolderIterator.hasNext()) {
        newFolderId = newFolderIterator.next().getId()
        var newFileList = DriveApp.getFolderById(newFolderId).getFiles()
        while(newFileList.hasNext()) {
          myFileName = newFileList.next()
          myFileId = myFileName.getId()
          var myFileURL = myFileName.getUrl()
          Logger.log(myFileName.getId() + " " + myFileName.getName()) //Logs the ID and Name
          Logger.log(myFileURL) //Logs the URL
          var ss = SpreadsheetApp.openById(myFileName.getId()) //Error, cannot find the ID (error message: perhaps it's missing?)
  
        }          
      }
  </code></pre>
  
  <p>I've tried using the openByURL as well, with the same error message.</p>
  
  <p>Probably really easy to fix, any hints and tips is appreciated.</p>
  
  <p>Thanks</p>