SHDocVw.InternetExplorer: DocComplete error


  • Hi,

    I would like to ask a question with InternetExplorer object.

    I read that there are two common control used for automating browsing: InternetExplorer and WebBrowser. Both controls use DocumentComplete event to indicate the finishing of downloading all frames.

    For WebBrowser control, there is an article How To Determine When a Page Is Done Loading in WebBrowser Control. The VB code is

    Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object,
                                             URL As Variant)
       If (pDisp Is WebBrowser1.Object) Then
          Debug.Print "Web document is finished downloading"
       End If
    End Sub

    However, I didn't find the above work for my VSTO 2010 Excel document-level project using InternetExplorer object.

    Could anyone instruct me how I should modify the code?


    • Modifié Bob Sun mercredi 22 février 2012 22:37
    mercredi 22 février 2012 22:37

Toutes les réponses

  • I think you need to compare the return value of Marshal.GetIDispatchForObject for the event source as well as the webbrowser.  

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP

    jeudi 23 février 2012 01:44