M
MarkHear1
Hi all,
I asked in here the other day how i could get rid of :
Application.Wait Now + TimeValue("00:00:3")
from my code and instead wait for a page to be fully loaded before the
program continues running, someone kindly told me to use:
Do Until ie.ReadyState = 4
DoEvents
Loop
However i was unable to get this to work, if anybody could offer some
help it would be greatly appreciated, my code is below:
Sub CDS_Test()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
With ie
..Navigate "URL"
..Visible = True
Do Until .ReadyState = 4
DoEvents
Loop
End With
Set ipf = ie.Document.all.Item("p1_command")
ipf.Value = "my user ID"
Set ipf = ie.Document.all.Item("pw1_command")
ipf.Value = "my password"
SendKeys "{ENTER}"
Application.Wait Now + TimeValue("00:00:3")
SendKeys "{Tab 2}", True
SendKeys "{ENTER}"
Application.Wait Now + TimeValue("00:00:3")
SendKeys "{Tab 3}", True
SendKeys "{ENTER}"
Many Thanks,
Mark
I asked in here the other day how i could get rid of :
Application.Wait Now + TimeValue("00:00:3")
from my code and instead wait for a page to be fully loaded before the
program continues running, someone kindly told me to use:
Do Until ie.ReadyState = 4
DoEvents
Loop
However i was unable to get this to work, if anybody could offer some
help it would be greatly appreciated, my code is below:
Sub CDS_Test()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
With ie
..Navigate "URL"
..Visible = True
Do Until .ReadyState = 4
DoEvents
Loop
End With
Set ipf = ie.Document.all.Item("p1_command")
ipf.Value = "my user ID"
Set ipf = ie.Document.all.Item("pw1_command")
ipf.Value = "my password"
SendKeys "{ENTER}"
Application.Wait Now + TimeValue("00:00:3")
SendKeys "{Tab 2}", True
SendKeys "{ENTER}"
Application.Wait Now + TimeValue("00:00:3")
SendKeys "{Tab 3}", True
SendKeys "{ENTER}"
Many Thanks,
Mark