With help last year I developed a spreadsheet to import tables of data from this football stats website (http://www.soccerbot.com/france/results/fra2010x.htm?Team=All Teams) into excel, the code has worked for the past two years, but now without making any changes the worksheet has stopped working and displays one of the following errors;
Runtime error 13 “Mismatch” on the line highlighted below.
Runtime Error 462 : Remote server machine does not exist or unavailable with the line highlighted below
highlighting the line;
Set oResultPage = ie.Document.
I have uploaded the worksheet I use.
http://www.filefactory.com/file/b3010g9/n/Goal_Times1.xls
Not being very good at Excel code can anybody help to fix the workbook to get it working again?
Thanks
Runtime error 13 “Mismatch” on the line highlighted below.
Runtime Error 462 : Remote server machine does not exist or unavailable with the line highlighted below
highlighting the line;
Set oResultPage = ie.Document.
Code:
Sub getdata()
Dim ie As InternetExplorer
Dim i As Range
Dim x As Range
Dim y As Range
Dim BinString As String
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
'Go to this Web Page!
ie.navigate r.Text
'Check for good connection to web page loop!
Do Until ie.readyState = READYSTATE_COMPLETE
DoEvents
Application.Wait Now() + TimeValue("00:00:01")
Application.SendKeys "~"
Loop
Do Until ie.Busy = False
DoEvents
Loop
Dim oResultPage As HTMLDocument
Dim AllTables As IHTMLElementCollection
Dim xTable As HTMLTable
Dim TblRow As HTMLTableRow
Dim myWkbk As Worksheet
Sheets(2).Select
Cells.Delete
'copy "data" table
Set oResultPage = ie.Document
Set AllTables = oResultPage.getElementsByTagName("table")
Set xTable = AllTables.Item(0)
Set myWkbk = ActiveWorkbook.Sheets("InputData")
For Each TblRow In xTable.Rows
k = k + 1
For Each tblCell In TblRow.Cells
c = c + 1
myWkbk.Cells(k, c) = tblCell.innerText
Next tblCell
c = 0
Next TblRow
k = 0
ie.Quit
End Sub
I have uploaded the worksheet I use.
http://www.filefactory.com/file/b3010g9/n/Goal_Times1.xls
Not being very good at Excel code can anybody help to fix the workbook to get it working again?
Thanks