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:
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) hdoc_complete = False End Sub Private Sub wbrowser_DocumentComplete(ByVal pDisp As Object, URL As Variant) If (pDisp Is wbrowser.Object) Then hdoc_complete = True End If End Sub and in the main sub wbrowser.Navigate2 (wbrowser.Document.frames.Item(5).Document.All.tags("A").Item(3).href) DoEvents Do While hdoc_complete = False DoEvents Loop
the problem is that the computer halts and hdoc_complete is FALSE ALL THE TIME.
please help because microsoft screwed it again !!!




Reply With Quote