Results 1 to 3 of 3

Thread: Run-time error 91, object variable or With block variable not set

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2008
    Posts
    2

    Run-time error 91, object variable or With block variable not set

    I am new to vb6. I am trying to automatically click a button on a web age. I keep getting the run-time error 91, object variable or With block variable not set. I have also set the HTML object library. Can I get some advice. Here is my code. Thanks

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

    Dim doc As HTMLDocument
    Set doc = WebBrowser1.Document
    doc.All("btnAcknowledge").Click

    End Sub

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Run-time error 91, object variable or With block variable not set

    Welcome to the forums!

    How about trying the WebBrowser1_NavigateComplete2 instead?

    Or you could use the .Busy property of the Webbrowser...

    Code:
    WebBrowser1.Navigate "www.vbforums.com"
    Do While WebBrowser1.Busy = True
            DoEvents
            Sleep 500
        Loop
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2008
    Posts
    2

    Re: Run-time error 91, object variable or With block variable not set

    Thanks for your input, however, I used WebBrowser1_NavigateComplete2 and I still receive the same error for the line "doc.All("btnAcknowledge").Click"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width