Hi support,
Could some one please let know what am I doing wrong here. I have run the following script several times. But sometime It display the message box and sometime it does not. I just can't figure out what is the problem with it.
Thanks soooooooo much for your help.
VBSTART
Dim IE
Sub CreateIE(ShowIE)
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible=ShowIE
End Sub
Sub Navigate(URL)
IE.Navigate URL
End Sub
Sub WaitBusy
do while IE.Busy
loop
End Sub
Sub KillIE
IE.Quit
Set IE = nothing
End Sub
Sub FindText(sSearch,sTagName)
dim Num
dim t
dim sText
set t = IE.document.getElementsbyTagname(sTagName)
for Num = 0 to t.length-1
sText = t.item(Num).innerText
if instr(sSearch,sText) > 0 then
msgbox "search = " & sSearch & ", innertext = " & t.item(Num).innerText
exit for
end if
next
End sub
VBEND
VBRun>CreateIE,1
VBRun>Navigate,http://www.sportingbet.com.au/uipub/?ev ... tType=dogs
VBRun>WaitBusy
waitwindowopen>Sportingbet Australia*
VBRun>FindText,Arvos Maria,TR
VBRun>KillIE
Need some help please please
Moderators: Dorian (MJT support), JRL
I put in a few Wait> commands to try to see if anything unexpected was happening and your message box has worked on every attempt.
Here is your code with my changes. Like I said, only added Wait> to slow it down.
Here is your code with my changes. Like I said, only added Wait> to slow it down.
Code: Select all
VBSTART
Dim IE
Sub CreateIE(ShowIE)
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible=ShowIE
End Sub
Sub Navigate(URL)
IE.Navigate URL
End Sub
Sub WaitBusy
do while IE.Busy
loop
End Sub
Sub KillIE
IE.Quit
Set IE = nothing
End Sub
Sub FindText(sSearch,sTagName)
dim Num
dim t
dim sText
set t = IE.document.getElementsbyTagname(sTagName)
for Num = 0 to t.length-1
sText = t.item(Num).innerText
if instr(sSearch,sText) > 0 then
msgbox "search = " & sSearch & ", innertext = " & t.item(Num).innerText
exit for
end if
next
End sub
VBEND
VBRun>CreateIE,1
wait>3
VBRun>Navigate,http://www.sportingbet.com.au/uipub/?eventId=413560&eventType=dogs
wait>3
VBRun>WaitBusy
waitwindowopen>Sportingbet Australia*
waitready>0
wait>5
VBRun>FindText,Arvos Maria,TR
wait>3
VBRun>KillIE