title: MSXML2.XMLHTTP send method works with early binding, fails with late binding
body: <p>The code below works. But if I comment out the line <code>Dim objRequest As MSXML2.XMLHTTP</code> and uncomment the line <code>Dim objRequest As Object</code> it fails with the error message :</p>
  
  <blockquote>
    <p>The parameter is incorrect</p>
  </blockquote>
  
  <p>Why, and what (if anything) can I do about it?</p>
  
  <pre><code>Public Function GetSessionId(strApiId, strUserName, strPassword) As String
  
      Dim strPostData As String
  
      Dim objRequest As MSXML2.XMLHTTP
      'Dim objRequest As Object '
  
      strPostData = "api_id=" &amp; strApiId &amp; "&amp;user=" &amp; strUserName &amp; "&amp;password=" &amp; strPassword
  
      Set objRequest = New MSXML2.XMLHTTP
      With objRequest
          .Open "POST", "https://api.clickatell.com/http/auth", False
          .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
          .send strPostData
          GetSessionId = .responseText
      End With
  
  End Function
  </code></pre>
  
  <hr>
  
  <p>Corey, yes, I know I would have to do that in order for my code to work without a reference to the MSXML type library. That's not the issue here. The code fails when using <code>Dim objRequest As Object</code> regardless of whether I use </p>
  
  <p><code>Set objRequest = NEW MSXML2.XMLHTTP</code> with the reference, or </p>
  
  <p><code>Set objRequest = CreateObject("MSXML2.XMLHTTP")</code> without the reference.</p>