DocumentCompleted can fire multiple times and only the last time will be the real McCoy. You can get lost in your code where one DocumentCompleted is waiting for the While to finish and another DocumentCompleted gets raised, your code starts another Do...While and so on.
Try it with a simple If:
If WebBrowser1.ReadyState = WebBrowserReadyState.Complete Then
'your code
A simpler (lamer) way would be:Code:If WebBrowser1.ReadyState <> WebBrowserReadyState.Complete Then Exit Sub End If 'your code




Reply With Quote