VERY strange behavior on createobject("HMTLFILE")!

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?

Line where the strange behavior starts: Set htmlObj = CreateObject("HTMLFILE")

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 <> 4: DoEvents: Wend While oXMLHTTP.Status <> 200: DoEvents: Wend  Set htmlObj = CreateObject("HTMLFILE")  htmlObj.body.innerHTML = oXMLHTTP.responseText Set XMLHTTP_Request = htmlObj  End Function 

Replay

Category: excel Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.113 (s). 12 q(s)