Controlling IE with Excel VBA

ScottSmallwood

New Member
Joined
Oct 17, 2012
Messages
3
I am trying to navigate through a number of web pages using VBA. I first goto the login page and login using my password. When I click do ieForm.submit the actual IE application goes to the next page, but my IE object is still looking at the old web page.

Here is my code. Any help would be much appreciated. Thanks.

Sub IE_login()
Dim IE As InternetExplorer, ieForm
Dim MyPass As String, MyLogin As String

Application.StatusBar = "Loading 5Dimes"
' MyLogin = Application.InputBox("Please 5Dimes login", "5Dimes UserName", Default:="password", Type:=2)
' MyPass = Application.InputBox("Please 5Dimes password", "5Dimes Password", Default:="password", Type:=2)
MyLogin = "test"
MyPass = "dummy"

Set IE = New InternetExplorer
IE.Visible = True
IE.Navigate "http://www.5dimes.eu/"

'Loop until ie page is fully loaded
Do Until IE.ReadyState = READYSTATE_COMPLETE
Loop

' Look for password Form by finding test "Password"
Application.StatusBar = "Logging On"
For Each ieForm In IE.Document.forms
If (ieForm.Name = "LoginForm") Then
ieForm(0).Value = MyLogin
ieForm(1).Value = MyPass
ieForm.submit
Exit For
End If
Next
Dim x As Variant
Set x = IE.Document.getElementById("Basketball_Reduced")
IE.Document.getElementById("Basketball_Reduced").Checked = True
IE.Document.submit

End Sub
 
Last edited by a moderator:

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,223,911
Messages
6,175,334
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top