Hi,
Following is the HTML code:
Following is the VBA Code:
But I am getting run time error 91
have tried many combinations like using class name and name, also have tried directly using country.value instead of getAttribute(), but still getting the same error.
Following is the HTML code:
HTML:
<input name="tb_country" type="text" value="Germany" readonly="readonly" id="tb_country" class="detailtextbox">
VBA Code:
Private Sub Btn_Click()
Dim IE As Object
Dim doc As HTMLDocument
DIM country As IHTMLElement
Set IE = New InternetExplorerMedium
IE.visible = True
IE.navigate "https://intranetsite.com"
Do While IE.readyState<>READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
Set doc=IE.document
Set Country = doc.getElementByID("tb_country")
Cells(3,2).value=Country.getAttribute("value")
IE.Quit
Set IE.Nothing
End Sub
But I am getting run time error 91
have tried many combinations like using class name and name, also have tried directly using country.value instead of getAttribute(), but still getting the same error.