I am trying to fill in the form of this webpage "https://login.yahoo.com/account/cre...n-US&done=https://www.yahoo.com&specId=yidReg" with the help of excel vba.
Everything is working fine, except I am failing to choose option from combobox, where i need to choose 'country code'.
ID of the combobox= "country-code-lbl-aria"
I have tried this code:
It shows this error:
Run-time error 438
Object doesn't support this property or method
on this line- For i = 1 To country.Option.Length
I did change code for the combobox:
It shows this error:
Run-time error 438
Object doesn't support this property or method
on this line- drp.selectedIndex = 5
Thanks in advance, Anyone wanting to help, is highly appreciated
Everything is working fine, except I am failing to choose option from combobox, where i need to choose 'country code'.
ID of the combobox= "country-code-lbl-aria"
I have tried this code:
Code:
Sub iepart2()
Dim ie As Object
'
Set ie = CreateObject("internetexplorer.application")
With ie
.Visible = True
.navigate "https://login.yahoo.com/account/create?src=fpctx&intl=us&lang=en-US&done=https%3A%2F%2Fwww.yahoo.com&specId=yidReg"
Do While .busy
DoEvents
Loop
Do While .readystate <> 4
DoEvents
Loop
Set country = ie.document.getElementById("[FONT=Consolas]country-code-lbl-aria[/FONT]")
For i = 1 To country.Option.Length
If country.Options(i).Text = "Albania (+355)" Then
country.selectedIndex = i
Exit For
End If
Next i
End With
End Sub
Run-time error 438
Object doesn't support this property or method
on this line- For i = 1 To country.Option.Length
I did change code for the combobox:
Code:
Set HTML = ie.document
Dim drp As HTMLFormElement
Set drp = HTML.getElementById("country-code-lbl-aria")
Dim x As Long
x = HTML.forms.Length
drp.selectedIndex = 5
It shows this error:
Run-time error 438
Object doesn't support this property or method
on this line- drp.selectedIndex = 5
Thanks in advance, Anyone wanting to help, is highly appreciated