+ Reply to Thread
Results 1 to 2 of 2

Unable to get VBA to log onto website

  1. #1
    Registered User
    Join Date
    10-09-2017
    Location
    Perth, Australia
    MS-Off Ver
    Office 16
    Posts
    1

    Unable to get VBA to log onto website

    Hi

    Please HELP me I have been stuck for 3 days now!!!

    I have the below code, it opens the website www.reece.com.au/myaccount/login, but does not fill in the email and password (Correct information on code has been removed for privacy)

    I assume it is not working as I have not referenced the correct name in HTML. I assume it is email and password, but I may be wrong. I also am unable to find if MyHTML_Element.Type = "submit" is actually submit.

    Can anyone please look at the HTML and tell me if I have the wrong information in my VBA?


    Dim HTMLDoc As HTMLDocument
    Dim MyBrowser As InternetExplorer
    Sub MyReece()



    Dim MyHTML_Element As IHTMLElement
    Dim MyURL As String

    On Error GoTo Err_Clear
    MyURL = "https://www.reece.com.au/myaccount/login"

    Set MyBrowser = New InternetExplorer

    MyBrowser.Silent = True
    MyBrowser.navigate MyURL
    MyBrowser.Visible = True
    Do
    Loop Until MyBrowser.readyState = READYSTATE_COMPLETE
    Set HTMLDoc = MyBrowser.document
    HTMLDoc.all.Email.Value = "Infousername"
    HTMLDoc.all.password.Value = "Info password"
    For Each MyHTML_Element In HTMLDoc.getElementsByTagName("input")
    If MyHTML_Element.Type = "submit" Then MyHTML_Element.Click: Exit For
    Next
    Err_Clear:
    If Err <> 0 Then
    Err.Clear
    Resume Next
    End If
    End Sub

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,421

    Re: Unable to get VBA to log onto website

    cross-posted https://www.mrexcel.com/forum/excel-...e-via-vba.html

+ 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. Get Data from a Website - Unable to click Button
    By karan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2016, 04:45 PM
  2. Unable to get specific text off a website using getElementBy method
    By mintymike in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-18-2015, 07:18 AM
  3. Unable to Pull data from a Website
    By captaincrazzy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-22-2015, 03:58 PM
  4. Replies: 2
    Last Post: 08-13-2014, 12:10 PM
  5. [SOLVED] Unable to Login to YES BANK Corporate website
    By Naveed Raza in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-24-2014, 07:58 AM
  6. Unable to Access Excel Forum Website Intermittently
    By smuzoen in forum The Water Cooler
    Replies: 19
    Last Post: 03-01-2013, 11:48 AM
  7. Replies: 3
    Last Post: 11-08-2012, 07:25 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