The problem happens only when used getElementsByClassName
Dim HTTP As New MSXML2.XMLHTTP60
HTTP.open "POST", strWWW, False
HTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
HTTP.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
HTTP.send ("obj=" & strID)
Dim HTML As New MSHTML.HTMLDocument
HTML.body.innerHTML = HTTP.responseText
Dim eleCol As MSHTML.IHTMLElementCollection
Set eleCol = HTML.getElementsByClassName("listEvent sro") '<-- The problem is happening here.
The tests are being done on Windows 8.1 and Windows XP
Windows 8.1
While in IDE everything works normally, but when compiled simply the error appears:
mshtml.dll 11.00.9600.18860
mshtml.tlb 11.0.9600.16518
The method exists, but now why it works while in IDE, but not when compiled?
Windows XP
Not even in the IDE worked, presenting the following error message:
mshtml.dll 8.0.6001.23588
mshtml.tlb 8.0.6001.18702 (old version and there is no getElementsByClassName)
mshtml.tlb 11.0.9600.16518 (using this version but it does not work)
What am I doing wrong?


Try the following workaround which uses css selector syntax to select by class. With modern browsers it is a faster method for matching on elements. It may work.
Also, test whether you can remove the compound class usage and have a single class e.g.
You use a
For Loopfrom0to.Length -1over the returnednodeList.