Does anybody know how to know if Navigate2 function of Webbrowser control has finished?

I navigate to a website then navigate to a link of a frame of this website.
The problem is that the computer does not wait until the navigating has finished.

i read i should type something like this
VB Code:
  1. Private Sub wbrowser_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
  2. hdoc_complete = False
  3. End Sub
  4.  
  5.  
  6.  
  7.  
  8. Private Sub wbrowser_DocumentComplete(ByVal pDisp As Object, URL As Variant)
  9. If (pDisp Is wbrowser.Object) Then
  10. hdoc_complete = True
  11. End If
  12.  
  13. End Sub
  14. and in the main sub
  15.  
  16. wbrowser.Navigate2 (wbrowser.Document.frames.Item(5).Document.All.tags("A").Item(3).href)
  17.     DoEvents
  18.    
  19.     Do While hdoc_complete = False
  20.         DoEvents
  21.     Loop

the problem is that the computer halts and hdoc_complete is FALSE ALL THE TIME.

please help because microsoft screwed it again !!!