After button element "ContentPlaceHolder2_btnSearch" is click, element "cbSite_I" returns to blank. I want element "cbSite_I" to have value "Cát Lái" after element "ContentPlaceHolder2_btnSearch" is click. Pls kindly help me accordingly. Thanks.
Visible Text on websit :
Button : "Search"
elements("cbSite_I") : "Container delivery area" Box.
elements("txtItemNo_I") : "Container (*)" Box
Visible Text on websit :
Button : "Search"
elements("cbSite_I") : "Container delivery area" Box.
elements("txtItemNo_I") : "Container (*)" Box
Code:
Sub Web()
Dim IE As New SHDocVw.InternetExplorer
On Error GoTo Errorcatch
Application.ScreenUpdating = False
IE.Visible = True
IE.Navigate "https://eport.saigonnewport.com.vn/Pages/Common/Containers_new"
Do While IE.ReadyState <> READYSTATE_COMPLETE Or IE.Busy
DoEvents
Loop
'Application.Wait Now + TimeSerial(0, 0, 5)
IE.document.forms("form2").elements("cbSite_I").Value = "Cát Lái"
IE.document.forms("form2").elements("txtItemNo_I").Value = "MSKU1183832"
IE.document.forms("form2").elements("ContentPlaceHolder2_btnSearch").Click
Do While IE.ReadyState <> READYSTATE_COMPLETE Or IE.Busy
DoEvents
Loop
'Application.Wait Now + TimeSerial(0, 0, 5)
Range("A2").Value = IE.document.getElementById("grdContainer_DXDataRow0").Children(17).textContent
Set IE = Nothing
IE.Quit
Exit Sub
Errorcatch:
MsgBox Err.Description
Set IE = Nothing
IE.Quit
End Sub