PDA

View Full Version : Excel vba code to automate IE.



reda
02-04-2017, 01:43 AM
Hi guys.
I have the below code that supposed to log to a website that requires a pw only.
But it doesnt work.

Sub OpenCIR()

Set objIE = CreateObject("InternetExplorer.Application")
WebSite = "******"
With objIE
.Visible = True
.Navigate WebSite
**Do While .Busy Or .readyState <> READYSTATE_COMPLETE**
DoEvents
Loop
On Error Resume Next

Set Element = .document.getElementsById(" _id0:logon:PASSWORD")
Element.Item(0).Value ="hello123"

Do While .Busy Or .readyState <> READYSTATE_COMPLETE
DoEvents
Loop

End With

End Sub

Here is the html code for the web page pw part.


<div class="logoninput">
<input type="password" id="_id0:logon:PASSWORD" name="_id0:logon:PASSWORD">
</div>


Please help i think the issue only with the id part.
And what the colons means in the id part.