Is there something less Processor intensive then DoEvents?
I have a program that needs to wait for a web page to load completely. I do this by setting a global boolean variable when the document = DocumentComplete.
VB Code:
Public Function GotoWebPage(vWebPage as string) as boolean
wb.Navigate = vWebPage
wpReadyFlag = False
Do While wpReadyFlag = False
DoEvents
Loop
End Function
Private Sub wb_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If wb.ReadyState = READYSTATE_COMPLETE Then
wpReadyFlag = True
End If
End Sub
When this runs (and it runs many many times) the processor spikes to 100% for the duration of the page load. Is there something else I can do instead of "DoEvents"?
Aye, all good idea's but...
I've tried them all.. If I put my code in the document_complete sub it get's WAY out of hand trying to figure out what page I'm on. It sort of works but there is a lot more going on then I can put here.. SleepEX puts my whole application to bed when there are many other parts of the application running different items and other browser windows.
Thanks for the suggestions tho :) I do appreciate it, and I should have mentioned that I've tried those before.. my bad.
Any othere ideas?