title: Why do I get an 'Invalid argument: url' error in the openByUrl(formURL) call?
body: <p>I have a form created in a Google Apps spreadsheet and I am trying to find out some of the forms parameter data in my script.</p>
  <p>In the following code I don't understand why I am getting an 'Invalid argument' error at the line</p>
  <pre><code>var myForm = FormApp.openByUrl(formURL);
  </code></pre>
  <p>even though the log shows what I think is a valid <code>formURL</code> string.</p>
  <pre><code>function myFunction() {
    var ss  = SpreadsheetApp.getActive();
    var formURL = ss.getGetFormURL();
    Logger.log('Spreadsheet\'s formURL: %s', formURL);
  
    var myForm = FormApp.openByUrl(formURL);  // Google script shows the ERROR here
    Logger.log('Form PublishedURL: %s', myForm.getPublishedUrl());
  
  }
  </code></pre>