I need to be able to call a function when a document is completed downloading.

I have tried this:

Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)

Call MyFunction

End Sub
But, MyFunction calls performs and operation and then calls another webpage. But, the Private Sub Document Complete seems to be getting ahead of itself and not waiting for the page to completely load.

Is there any way I can truly wait to call that function after the page has fully loaded?