+ Reply to Thread
Results 1 to 7 of 7

How to connect HTML Login page through excel vb macro

  1. #1
    Registered User
    Join Date
    07-19-2013
    Location
    India
    MS-Off Ver
    excel 2010
    Posts
    4

    How to connect HTML Login page through excel vb macro

    Hi there,

    i am new in vb coding,excel to excel i can do good coding but here i got new challenge.
    in my office there one web base software call e-horizon it is java base might be....

    i have script of login page, we are manually login in to this select region and user id and password

    what i am trying excel vb can automatically login into this page,

    please help me out how i can do this ???


    i have attached the txt file it contain the script thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: How to connect HTML Login page through excel vb macro

    Hello and welcome to the forum,

    If you have found a solution on your own, can you post it?

    Thanks.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    07-19-2013
    Location
    India
    MS-Off Ver
    excel 2010
    Posts
    4

    Re: How to connect HTML Login page through excel vb macro

    hi thanks for your prompt reply

    i have found the below coding for yahoo login it working fine



    Sub Login_2_Website()

    Dim HTMLDoc As HTMLDocument
    Dim oBrowser As InternetExplorer


    Dim oHTML_Element As IHTMLElement
    Dim sURL As String

    On Error GoTo Err_Clear
    sURL = "https://login.yahoo.com/config/login?.src=fpctx&.intl=in&.pd=c%3D6T7evjap2e6CwWSb86QVdqk-&.done=http%3A%2F%2Fin.yahoo.com%2F"
    Set oBrowser = New InternetExplorer
    oBrowser.Silent = True
    oBrowser.timeout = 60
    oBrowser.navigate sURL
    oBrowser.Visible = True

    Do
    ' Wait till the Browser is loaded
    Loop Until oBrowser.readyState = READYSTATE_COMPLETE

    Set HTMLDoc = oBrowser.document

    HTMLDoc.all.login.Value = "[email protected]"
    HTMLDoc.all.passwd.Value = "xxxxxxx"

    For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
    If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For
    Next

    ' oBrowser.Refresh ' Refresh If Needed
    Err_Clear:
    If Err <> 0 Then
    Debug.Assert Err = 0
    Err.Clear
    Resume Next
    End If
    End Sub

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: How to connect HTML Login page through excel vb macro

    Thanks for sharing the code. Please don't forget to use code tags around your code. Instruction below.

    Good luck.

    abousetta


    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

  5. #5
    Registered User
    Join Date
    07-19-2013
    Location
    India
    MS-Off Ver
    excel 2010
    Posts
    4

    Re: How to connect HTML Login page through excel vb macro

    HI abousetta,

    i apologie for inconvenience
    do you have any solution, where should i make the correction in my given vb coding to login ehorizon web page (ehorizon script in attachment file)?

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: How to connect HTML Login page through excel vb macro

    I honestly hate coding IE connections, especially that use js, so I won't be much help.

    Even so, you might want to remove the [SOLVED] prefix to the thread or else no one will really look at it.

    abousetta

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: How to connect HTML Login page through excel vb macro

    Do you have a URL?
    If posting code please use code tags, see here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 11-08-2012, 05:13 PM
  2. Creating a login page with Excel
    By TammamD in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-13-2011, 03:18 AM
  3. VBA: Login problems to HTML page + request file data
    By PBMClubber in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-28-2011, 04:55 AM
  4. [SOLVED] Save Excel book as Html Page Using Macro
    By Excel in forum Excel General
    Replies: 3
    Last Post: 02-21-2006, 10:10 AM
  5. Save Excel book as Html Page Using Macro
    By bj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2006, 07:10 PM

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