XML : Excel and VBA: Runtime Error 91: Parsing using MSXML2

The code below runs perfectly well on my windows 8 tablet (Office 2013), however much slower (25% speed) of my laptop running Windows 7 (Office 2010). The code breaks down at do until lx = .rows.length - 1

However, as previously stated it works on one system but not the other. Additionally, I can change the dates and it works just fine. Any and all help would be appreciated thank you.

  Dim strTeamBatting As String  Dim html As Object  Dim strPlayer As String  Dim lx, ly As Long  Dim iResult As Integer  Dim strResult As String    Set html = CreateObject("htmlFile")    With CreateObject("msxml2.xmlhttp")       .Open "GET", HTML_URL, False       .send       html.body.innerhtml = .responsetext  End With    strTeamBatting = "ChicagoCubsbatting"    With html.getelementbyid(strTeamBatting)       lx = 0  Do Until lx = .Rows.Length - 1      strPlayer = .Rows(lx).Cells(0).innertext          If strPlayer <> "Batting" Then              msgbox(strplayer)                   Else          End If  lx = lx + 1  Loop  End With    

No comments:

Post a Comment