Consulting

Results 1 to 4 of 4

Thread: IE Automation using VBA

  1. #1
    VBAX Newbie
    Joined
    Jul 2010
    Posts
    2
    Location

    IE Automation using VBA

    Hi,

    I am kind of new to VBA and automation.

    Actually I am trying to automate the below process,

    Open a new browser, goto the URL
    Supply credentials and login
    In the next page click on a explorer icon present in that page

    I tried to do some coding and i have been successful only till opening the page and after seems like impossible to me...

    Below is the code of what i have done so far,


    [vba]
    Public Sub ie()
    Dim ie As Object
    Dim lform As Object

    Set ie = CreateObject("internetexplorer.Application")
    ie.navigate2 "******"
    Do Until ie.readystate = 4
    DoEvents
    Loop
    ie.Visible = True ' optional
    Set lform = ie.document.forms(0)
    With lform
    lform("username").Value = "****"
    lform("password").Value = "****"
    lform.submit
    End With
    ie.Quit
    Set ie = Nothing
    End Sub

    [/vba]



    Please help me with the remaining, excel vba or vbs anyway is fine with me, since my aim is to automate the process.
    The site that i am trying to code in the url part is,
    h ttps://extcitrix.wellpoint.com(pls remove the space between 'h' and 'ttps')

    Please reply if you need any more details

    Thanks in advance for your help.

  2. #2
    View the HTML source to determine the form field names.

    Also you probably want to delete the Quit and Nothing lines, otherwise IE will disappear after the login.

  3. #3
    VBAX Newbie
    Joined
    Jul 2010
    Posts
    2
    Location
    hi

    its a java scripted page thats where am struck am not able to get the user name and password values

  4. #4
    Both values are viewable if you look for them. The user name input box is in plain HTML in the web page source. The password box is generated by Javascript, but the script just writes HTML to the web page - look at the ns_showpwd() function in https://extcitrix.wellpoint.com/vpn/login.js.

    [vba]Public Sub IE_Login()
    Dim IE As Object
    Dim lform As Object

    Set IE = CreateObject("InternetExplorer.Application")
    With IE
    .Navigate2 "https://extcitrix.wellpoint.com"
    Do Until .ReadyState = 4
    DoEvents
    Loop
    .Visible = True
    Set lform = .Document.forms(0)
    With lform
    .Item("login").Value = "Your Username"
    .Item("passwd").Value = "Your Password"
    .submit
    End With
    Do Until .ReadyState = 4
    DoEvents
    Loop
    End With
    End Sub [/vba]

Posting Permissions

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