title: VERY strange behavior on createobject("HTMLFILE")!
body: <p>I don't understand why I'm getting this strange behavior!
  When creating and assigning the htmlfile object the function gives back a blank object ("nothing") and when I am running the code line by line it just runs automatically even when I don't press F8 to run the next line...
  It gives no error whatsoever!
  Any ideas as to what might be happening?</p>
  
  <p>Line where the strange behavior starts: <code>Set htmlObj = CreateObject("HTMLFILE")</code></p>
  
  <pre><code>Public Function XMLHTTP_Request(Method As String, URL As String, Optional PostData As String, Optional StrCookie As String) As HTMLDocument
  
  Dim oXMLHTTP As Object, htmlObj as object
  Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP")
  oXMLHTTP.Open Method, URL, False
  oXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  oXMLHTTP.setRequestHeader "Cookies", StrCookie
  
  On Error GoTo ErrorHandler
  oXMLHTTP.send (PostData)
  On Error GoTo 0
  
  While oXMLHTTP.ReadyState &lt;&gt; 4: DoEvents: Wend
  While oXMLHTTP.Status &lt;&gt; 200: DoEvents: Wend
  
  Set htmlObj = CreateObject("HTMLFILE")
  
  htmlObj.body.innerHTML = oXMLHTTP.responseText
  Set XMLHTTP_Request = htmlObj
  
  End Function
  </code></pre>