Hello,
I try to write a macro for:
1) Opening a certain webpage in Interner Explorer 11 (I am using 64-Bit MS Excel 2016)
2) Going to specific fields within a website
3) Providing "User ID" and "Password" values
4) Clicking "Login" button
I am a VBA beginner Thank you in advnce for any help!
Below I provide my current code, which gets stuck on:
Do Until Not ie.Busy And ie.readyState = 4 (I've got to put "xxx" in terms of company data protection):
Sub Open_Login()
Set ie = CreateObject("InternetExplorer.Application")
my_url = "xxx"
With ie
.Visible = True
.navigate my_url
.Top = 50
.Left = 530
.Height = 400
.Width = 400
Do Until Not ie.Busy And ie.readyState = 4
DoEvents
Loop
End With
ie.document.getElementById("xxx").Value = "xxx"
ie.document.getElementById("xxx").Value = "xxx"
ie.document.getElementById("xxx").Click
Do Until Not ie.Busy And ie.readyState = 4
DoEvents
Loop
End Sub
I've also found sth like this in the web, but did not test it yet:
Sub Open_Login()
Set ie = CreateObject("InternetExplorer.application")
ie.Visible = True
ie.navigate ("xxx" & ActiveCell)
Do
If ie.readyState = 4 Then
ie.Visible = True
Exit Do
Else
DoEvents
End If
Loop
ie.document.forms(0).all("xxx").Value = "xxx"
ie.document.forms(0).all("xxx").Value = "xxx"
ie.document.forms(0).submit
End Sub
I try to write a macro for:
1) Opening a certain webpage in Interner Explorer 11 (I am using 64-Bit MS Excel 2016)
2) Going to specific fields within a website
3) Providing "User ID" and "Password" values
4) Clicking "Login" button
I am a VBA beginner Thank you in advnce for any help!
Below I provide my current code, which gets stuck on:
Do Until Not ie.Busy And ie.readyState = 4 (I've got to put "xxx" in terms of company data protection):
Sub Open_Login()
Set ie = CreateObject("InternetExplorer.Application")
my_url = "xxx"
With ie
.Visible = True
.navigate my_url
.Top = 50
.Left = 530
.Height = 400
.Width = 400
Do Until Not ie.Busy And ie.readyState = 4
DoEvents
Loop
End With
ie.document.getElementById("xxx").Value = "xxx"
ie.document.getElementById("xxx").Value = "xxx"
ie.document.getElementById("xxx").Click
Do Until Not ie.Busy And ie.readyState = 4
DoEvents
Loop
End Sub
I've also found sth like this in the web, but did not test it yet:
Sub Open_Login()
Set ie = CreateObject("InternetExplorer.application")
ie.Visible = True
ie.navigate ("xxx" & ActiveCell)
Do
If ie.readyState = 4 Then
ie.Visible = True
Exit Do
Else
DoEvents
End If
Loop
ie.document.forms(0).all("xxx").Value = "xxx"
ie.document.forms(0).all("xxx").Value = "xxx"
ie.document.forms(0).submit
End Sub