I am trying to use XMLHTTP object in VBA to retrive HTML document and insert it to a HTMLDocument object for manipulating elements. But my codes got automation errors. I thoughly checked the codes but couldn't find any possible causes. Can someone help me fix the problem?
Many thanks in avance!
VBA Codes:
Sub RetrieveData()
Dim strURL As String
Dim strResponse As String
Dim objResponse As Object
Dim objHttpReq As Object
Dim objHTML As New HTMLDocument
strURL = "http://www.customs.go.jp/toukei/srch/indexe.htm?M=57& P=1,1,,,,,,,,,,2013,,9,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,"
Set objHttpReq = CreateObject("MSXML2.XMLHTTP.3.0")
objHttpReq.Open "GET", strURL, False
objHttpReq.send
strResponse = objHttpReq.responseText
objHTML.body.innerHTML = strResponse
MsgBox objHTML.body.innerHTML
End Sub