+ Reply to Thread
Results 1 to 8 of 8

Internet Explorer interaction

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-27-2006
    Location
    Cayman Islands
    Posts
    379

    Re: Internet Explorer interaction

    I can't really give away the website address online as it's probably not very secure, but the code I have is in the early stages and is as follows:

    Dim ie As InternetExplorer
    Dim C
    Dim Value1 As Boolean, ieForm
    Dim Value2 As String, MyLogin As String

    redo:
    Value1= Application.InputBox("Please enter value 1", "Ecaytrade username", Default:="Value1", Type:=2)
    Value2 = Application.InputBox("Please enter value 2", "Ecaytrade Password", Default:="Value2", Type:=2)

    If Value1 = "" Or Value2= "" Then GoTo redo

    Set ie = New InternetExplorer
    ie.Visible = True
    ie.Navigate "http://website address"

    'Loop until ie page is fully loaded
    Do Until ie.ReadyState = READYSTATE_COMPLETE
    Loop

    For Each ieForm In ie.Document.forms
    If InStr(ieForm.innertext, "Data Entry") <> 0 Then
    ULogin = True
    'enter details
    ieForm(1).Value = Value1
    ieForm(2).Value = Value2
    ieForm.submit
    Exit For
    Else
    End If
    Next
    Set ie = Nothing
    End Sub

  2. #2
    Forum Contributor
    Join Date
    04-27-2006
    Location
    Cayman Islands
    Posts
    379

    Re: Internet Explorer interaction

    ieForm.submit is where it fails with runtime error 438.

  3. #3
    Forum Contributor
    Join Date
    08-27-2009
    Location
    South Africa
    MS-Off Ver
    Office 2010
    Posts
    217

    Re: Internet Explorer interaction

    Try This

    Dim ieApp As InternetExplorer
        Dim ieDoc As Object
        Dim ieTable As Object
        Dim clip As DataObject
       
    
       Set ieApp = New InternetExplorer
       
    
       ieApp.Visible = True
       
    
       ieApp.Navigate "http://??????"
        Do While ieApp.Busy: DoEvents: Loop
        Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
               
        Set ieDoc = ieApp.Document
    
    
       With ieDoc.forms(0)
            .textUserName.Value = "username"
            .textPassword.Value = "password"
            SendKeys "{TAB}", True
            SendKeys "{TAB}", True
            SendKeys "{ENTER}", True
        End With
        
        Do While ieApp.Busy: DoEvents: Loop
        Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1