Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27349

Internet Explorer Control

$
0
0
This is my first time posting. Please forgive any mistakes, I am trying to do it correctly.
I am using Microsoft Visual Studio 2015. I am trying to is Internet Explorer to open a database here at my office. The built in WebBrowser control won't work for my office database. I can't seem to use some of the commands I see used by others online like "SET" or "mshtml". I have used timing and "sendkeys" to control the load of the web form, but I would rather control the loading by "GetObjectByID" commands. I am guessing this is just a setting change in my studio, but I can't seem to find the issue. Thank you in advance for any help. I have included my coding below. I works fine all the way through but the "Do While" statement actually does nothing at all.
Code:

Public Class Form1

    Public Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
       
        Dim appIE As Object = CreateObject("InternetExplorer.Application")
        With appIE
            .navigate("http://database_address")
            .visible = True
        End With 'works this far
        Do While appIE.busy
            System.Threading.Thread.Sleep(100)
        Loop
        Wait(6)
        SendKeys.Send("Username")
        SendKeys.Send("{tab}")
        SendKeys.Send("Password")
        EnterIt()
        Wait(10)
        SendKeys.Send("P554915|pwi0001")
        EnterIt()
        Wait(10)
        Tab(48)
        SendKeys.Send("560 REport")
        Wait(30)
        Tab(3)
        EnterIt()
        Wait(60)
        Tab(7)
        EnterIt()
        Wait(6)
        SendKeys.Send("^%(E)")
        appIE.quit()
    End Sub
    Private Sub Wait(ByRef Time As Integer)
        Dim x As Integer = 1
        For x = 1 To Time
            System.Threading.Thread.Sleep(1000)
        Next
    End Sub
    Private Sub Tab(ByRef Repeat As Integer)
        Dim x As Integer = 1
        For x = 1 To Repeat
            SendKeys.Send("{Tab}")
        Next
    End Sub
    Private Sub EnterIt()
        SendKeys.Send("{Enter}")
    End Sub
End Class


Viewing all articles
Browse latest Browse all 27349

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>