I am trying to automate the login to a website that I use regularly. I have written code that will succesfully:
1. Open the website
2. Enter the correct username
3. Enter the correct password
Whenever the code attempts to .submit the information I get a website error that states my username/password information is incorrect. However, when I deactivate the .submit and manually click "submit" with my mouse it logs into the website. One thing that I have noticed is that when I manually click "submit" the username changes from "MyUserName" to "********", but when the VBA code executes the .submit it does not make this adjustment. I am using Excel 2007 on a Windows 7 32 bit operating system. Here is the code:
Sub OpenSite()
Dim ieApp As InternetExplorer
Dim ieDoc As Object
Dim ieTable As Object
Dim clip As DataObject
Set ieApp = New InternetExplorer
ieApp.Visible = True
ieApp.Navigate "Website"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.Document
With ieDoc.forms(0)
.UserId.Value = "Username"
.PIN.Value = "Password"
.submit
1. Open the website
2. Enter the correct username
3. Enter the correct password
Whenever the code attempts to .submit the information I get a website error that states my username/password information is incorrect. However, when I deactivate the .submit and manually click "submit" with my mouse it logs into the website. One thing that I have noticed is that when I manually click "submit" the username changes from "MyUserName" to "********", but when the VBA code executes the .submit it does not make this adjustment. I am using Excel 2007 on a Windows 7 32 bit operating system. Here is the code:
Sub OpenSite()
Dim ieApp As InternetExplorer
Dim ieDoc As Object
Dim ieTable As Object
Dim clip As DataObject
Set ieApp = New InternetExplorer
ieApp.Visible = True
ieApp.Navigate "Website"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.Document
With ieDoc.forms(0)
.UserId.Value = "Username"
.PIN.Value = "Password"
.submit