The Code below was made in access 2003 and tested on IE6 and it worked fine, but after testing it on ie7 it gives off errors such as Object variable not defined, or Subscript out of range
Sub Kick_Off_Log_In()
Const str_usr = "qcc04"
Const str_pw = "qc"
Dim username As MSHTML.IHTMLInputElement
Dim Password As MSHTML.IHTMLInputElement
Dim LogInBtn As MSHTML.IHTMLInputElement
Dim username1 As MSHTML.IHTMLInputElement
Dim Password1 As MSHTML.IHTMLInputElement
Dim LogInBtn1 As MSHTML.IHTMLInputElement
Set iekickoff = CreateObject("InternetExplorer.Application")
iekickoff.navigate "
While iekickoff.Busy
DoEvents
Wend
Set username = iekickoff.Document.all.Item("loginIdTextBox")
Set Password = iekickoff.Document.all.Item("passwordTextBox")
Set LogInBtn = iekickoff.Document.all.Item("logonButton")
username.Value = str_usr
Password.Value = str_pw
LogInBtn.Click
While iekickoff.Busy
DoEvents
Wend
Set ie = CreateObject("InternetExplorer.Application")
ie.navigate "
While ie.Busy
DoEvents
Wend
Set username1 = ie.Document.all.Item("loginIdTextBox")
Set Password1 = ie.Document.all.Item("passwordTextBox")
Set LogInBtn1 = ie.Document.all.Item("logonButton")
username1.Value = str_usr
Password1.Value = str_pw
LogInBtn1.Click
While ie.Busy
DoEvents
Wend
iekickoff.Visible = 1
End Sub
I suspect it has something to do with the
While Ie.Busy
Doevents
Endw
Thanks in advance.
Sub Kick_Off_Log_In()
Const str_usr = "qcc04"
Const str_pw = "qc"
Dim username As MSHTML.IHTMLInputElement
Dim Password As MSHTML.IHTMLInputElement
Dim LogInBtn As MSHTML.IHTMLInputElement
Dim username1 As MSHTML.IHTMLInputElement
Dim Password1 As MSHTML.IHTMLInputElement
Dim LogInBtn1 As MSHTML.IHTMLInputElement
Set iekickoff = CreateObject("InternetExplorer.Application")
iekickoff.navigate "
While iekickoff.Busy
DoEvents
Wend
Set username = iekickoff.Document.all.Item("loginIdTextBox")
Set Password = iekickoff.Document.all.Item("passwordTextBox")
Set LogInBtn = iekickoff.Document.all.Item("logonButton")
username.Value = str_usr
Password.Value = str_pw
LogInBtn.Click
While iekickoff.Busy
DoEvents
Wend
Set ie = CreateObject("InternetExplorer.Application")
ie.navigate "
While ie.Busy
DoEvents
Wend
Set username1 = ie.Document.all.Item("loginIdTextBox")
Set Password1 = ie.Document.all.Item("passwordTextBox")
Set LogInBtn1 = ie.Document.all.Item("logonButton")
username1.Value = str_usr
Password1.Value = str_pw
LogInBtn1.Click
While ie.Busy
DoEvents
Wend
iekickoff.Visible = 1
End Sub
I suspect it has something to do with the
While Ie.Busy
Doevents
Endw
Thanks in advance.