Results 1 to 2 of 2

Thread: IE Automation - Exception from HRESULT: 0x800A01B6 - mshtml Reference

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2011
    Posts
    12

    IE Automation - Exception from HRESULT: 0x800A01B6 - mshtml Reference

    Hey there,

    Needing a little help. I'm trying to write an application to perform IE automation for a website. Here is the code:
    Code:
                ' For each check rate
                For intTime = 1 To intCheckRate
                    ' Try
                    Try
                        ' Set value
                        Dim objDoc As mshtml.IHTMLDocument = MainForm.objIE.Document
                        Dim objAnchorToClickOn As mshtml.IHTMLAnchorElement = MainForm.objIE.Document.getElementById("ctl01_AddRowtoExceptionArray_AddRowtoExceptionArray_AddRowtoExceptionArray")
                        'ctl01_AddRowtoExceptionArray_AddRowtoExceptionArray_AddRowtoExceptionArray
                        ' Exit loop
                        intTime = intCheckRate + 1
                    Catch ex As Exception
                        ' Do Nothing
                        Console.WriteLine(ex.ToString())
                        If (bolDebugger) Then MsgBox("Unable to find Add exception button")
                    End Try
                    ' Delay for wait refresh
                    Threading.Thread.Sleep(1500)
                Next intTime
    This error is occurring when I try assigning
    Code:
    mshtml.IHTMLAnchorElement = MainForm.objIE.Document.getElementById("ctl01_AddRowtoExceptionArray_AddRowtoExceptionArray_AddRowtoExceptionArray")
    as
    Code:
    objAnchorToClickOn IHTMLAnchorElement
    The element the script is grabbing is an anchor tag (<a></a>).

    Error:
    {"Exception from HRESULT: 0x800A01B6"}
    Any ideas?

  2. #2
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: IE Automation - Exception from HRESULT: 0x800A01B6 - mshtml Reference

    Threading.Thread.Sleep(1500) and why?


    can you please provide the website

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