Sub dhl()
Dim ie As SHDocVw.InternetExplorer
Set ie = New SHDocVw.InternetExplorer
Dim i As Integer
ie.Visible = True
ie.navigate "http://dct.dhl.com/input.jsp?langId=en&originCCId=SG"
Do
DoEvents
Loop Until ie.readyState = READYSTATE_COMPLETE
Dim doc As HTMLDocument
Set doc = ie.document
Dim sdd As String
With doc
.getElementById("ext-gen188").Value = 200000
.getElementById("ext-gen220").Value = "SINGAPORE"
.getElementById("ext-gen296").Value = "HONG KONG (HK)"
.getElementById("ext-gen352").Value = "Central"
.getElementById("details_weight_1").Value = 10
.getElementById("details_length_1").Value = 20
.getElementById("details_width_1").Value = 20
.getElementById("details_height_1").Value = 20
.getElementById("btn_quote_transit_time_and_prices").Click
End With
Do
DoEvents
Loop Until ie.readyState = READYSTATE_COMPLETE
sdd = doc.getElementById("ext-gen2281").Value
MsgBox sdd
End Sub
Please help
I am an absolute newbie to VBA programming, and searched on the internet found some goodie which could help automate my job.
Here are 2 problems I encountered.
1) I could input the Hong Kong into the form, but the problem is that I have to choose from the dropdown list. Simply putting .value Hong Kong is not possible.
2) Getting the data from the page, error 91.
Please helpppppp.
Thanks.
Dim ie As SHDocVw.InternetExplorer
Set ie = New SHDocVw.InternetExplorer
Dim i As Integer
ie.Visible = True
ie.navigate "http://dct.dhl.com/input.jsp?langId=en&originCCId=SG"
Do
DoEvents
Loop Until ie.readyState = READYSTATE_COMPLETE
Dim doc As HTMLDocument
Set doc = ie.document
Dim sdd As String
With doc
.getElementById("ext-gen188").Value = 200000
.getElementById("ext-gen220").Value = "SINGAPORE"
.getElementById("ext-gen296").Value = "HONG KONG (HK)"
.getElementById("ext-gen352").Value = "Central"
.getElementById("details_weight_1").Value = 10
.getElementById("details_length_1").Value = 20
.getElementById("details_width_1").Value = 20
.getElementById("details_height_1").Value = 20
.getElementById("btn_quote_transit_time_and_prices").Click
End With
Do
DoEvents
Loop Until ie.readyState = READYSTATE_COMPLETE
sdd = doc.getElementById("ext-gen2281").Value
MsgBox sdd
End Sub
Please help
I am an absolute newbie to VBA programming, and searched on the internet found some goodie which could help automate my job.
Here are 2 problems I encountered.
1) I could input the Hong Kong into the form, but the problem is that I have to choose from the dropdown list. Simply putting .value Hong Kong is not possible.
2) Getting the data from the page, error 91.
Please helpppppp.
Thanks.