Hi Everyone,
After looking for solutions I still can't fix this error. All the references are loaded like 'microsoft internet explorer controls' and 'html object library'.
The error is in this code:
The whole code is here:PHP Code:
quote = Trim(doc.getElementsByTagName("h2").innerText)
Thanks for any helpPHP Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As InternetExplorer, doc As HTMLDocument, rng As Range, ticker As String, quote As String
Set rng = Sheets("Sheet1").Range("A1")
ticker = rng.Value
Set ie = CreateObject("InternetExplorer.Application")
If Target.Row = rng.Row And Target.Column = rng.Column Then
ie.navigate "http://www.soccerpunter.com/soccer-statistics/Netherlands/Eredivisie-2014-2015/head_to_head_statistics/all/1515_AFC_Ajax/1516_Alkmaar_Zaanstreek"
Do
DoEvents
Loop Until ie.readyState = READYSTATE_COMPLETE
Set doc = ie.document
On Error GoTo handler
quote = Trim(doc.getElementsByTagName("h2").innerText)
On Error GoTo 0
Cells(1, 2).Value = quote
End If
Exit Sub
handler:
MsgBox "fout melding"
ie.Application.Quit
End Sub
Bookmarks