diagnose my vba code and html

wesley14

Board Regular
Joined
Dec 8, 2011
Messages
74
Hello to all! I have this problem with my code, basically heres what it does > load page > get html > click button (after this some part of the pag will reload)> then get html again > then click button then a a part of the page will reload and so on repetitively... here is my code:
Code:
Sub Website_Login_Test()
 
 

Application.ScreenUpdating = False
Dim oHTML_Element As IHTMLElement
Dim sURL As String
Dim evt As Object
On Error GoTo Err_Clear
sURL = [URL]http://www.xmypage.secure.jsp[/URL]
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.timeout = 60
oBrowser.Navigate sURL
oBrowser.Visible = True
Do
' Wait till the Browser is loaded
Loop Until oBrowser.READYSTATE = readystate_complete
Set HTMLDoc = oBrowser.Document
'HTMLDoc.all.q.Value = "search text"
'HTMLDoc.all.Password.Value = "examplepassword&quot"
 
 

Do While (oBrowser.Busy Or oBrowser.READYSTATE <> READYSTATE.readystate_complete)
  DoEvents
Loop
 
 
Call loopFiles
Call changeFilter
Call clickStart
Application.Wait (Now + TimeValue("00:00:02"))
Call noofMessages

Application.Wait (Now + TimeValue("00:00:02"))

Call loopFiles
Call changeFilter2
Call clickStart
Application.Wait (Now + TimeValue("00:00:02"))
Call noofMessages2
Application.Wait (Now + TimeValue("00:00:02"))

Call loopFiles
Call changeFilter3
Call clickStart
Application.Wait (Now + TimeValue("00:00:02"))
Call noofMessages3
the problem is , when the code runs the first click start, a part of the page will reload, but the next methods only get the 1st html values, I need to somewhat tell vba that the html has change so I can get the new values from that new html
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,216,186
Messages
6,129,393
Members
449,507
Latest member
rjwalker1973

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top