Need Help Pls - What's wrong with this?
I found some error while stepping through the code. Made some changes.
Can't go completely through code because I dont have permission to write.
Sub tabIE()
Dim objIE As Object
Dim response As String
msg = "How many items are you checking?"
response = InputBox(msg)
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.Visible = True
.Navigate "http://www.smcorp.com"
.resizable = True
End With
Do
DoEvents
Loop While objIE.busy
Do
DoEvents
Loop Until objIE.ReadyState = 4
Set oForm = objIE.Document.Forms 'changed from douments
For Each myform In oForm.Item
Select Case myform.Name
Case "shopper_memno"
oForm("shopper_memno").Value = _
"USERID" 'userid and password changed to protect the innocent.
Case "shopper_password"
oForm("shopper_password").Value = "USRPSWD"
Case "submit1"
oForm("submit1").Click
End Select
Next myform
Do
DoEvents
Loop While objIE.busy
Do
DoEvents
Loop Until objIE.ReadyState = 4
'Call tabIE2(response)
ActiveWorkbook.Save
Set oForm = Nothing
Set objIE = Nothing
End Sub
"DW" wrote:
would someone pls help? am kinda lost.....don't know what is wrong. webpage
loads ok, but then it seems readystate is continuous loop. Not sure.
Don
Code:
Sub tabIE()
Dim objIE As Object
Dim response As String
msg = "How many items are you checking?"
response = InputBox(msg)
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.Visible = True
.Navigate "http://www.smcorp.com"
.resizable = True
End With
Do
DoEvents
Loop While objIE.busy
Do
DoEvents
Loop Until objIE.ReadyState = 4
Set oForm = objIE.Documents.Forms
oForm("shopper_memno").Value = "USERID" 'userid and password changed to
protect the innocent.
oForm("shopper_password").Value = "USRPSWD"
oForm("submit1").Click
Do
DoEvents
Loop While objIE.busy
Do
DoEvents
Loop Until objIE.ReadyState = 4
Call tabIE2(response)
ActiveWorkbook.Save
Set oForm = Nothing
Set objIE = Nothing
End Sub
|