hresult 0x800a01b6 on seccond pass

0

I get an hresult 0x800a01b6 on the seccond passing of my code.

When it runs the first time it works but fails seccond time around. IE opens then program stops.

Dim pID As String
        Dim mesg As String
        Dim pw As String
        Dim Id As String
        Dim ie As Object
        Dim l As String

        'For Each Id In ListBox2.Items'
        For i As Integer = 0 To Me.ListBox2.Items.Count - 1
            Id = Me.ListBox2.Items(i).ToString
            If Id = "me " Then
                Id = "466901"
            ElseIf "you" Then
          Id =  "466942"
            End If
        ie = CreateObject("InternetExplorer.Application")
        ie.Navigate("http://www.webpage.com.au/")
        ie.Visible = True
            mesg = TextBox1.Text.ToString()
            pw = "....."
            ie.Document.All("password").Value = pw
            ie.Document.All("idpagers").Value = Id
            ie.Document.All("message").Value = mesg
            ie.Document.All("Send").Click()
            pID = ie.Document.All().ToString
            'MessageBox.Show(pID)
            MessageBox.Show(l & mesg & pw, "Test")'
        Next
    End Sub
visual-studio
visual-studio-2010
vbscript
asked on Stack Overflow Jul 15, 2016 by shaggs • edited Jul 15, 2016 by shaggs

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0