+ Reply to Thread
Results 1 to 11 of 11

How to make Excel automatically login on a website so it can retrieve data from the site

  1. #1
    Registered User
    Join Date
    11-25-2016
    Location
    Zagreb, Croatia
    MS-Off Ver
    Office 2013
    Posts
    4

    How to make Excel automatically login on a website so it can retrieve data from the site

    I used some data from a website in my workbook, and it works fine, but every time I re-open the excel file, I have to go to "edit query" and manually log in to the website. How can I make it so either it automatically logs in with a pre set mail and password, or so that there is a login form in my excel sheet so I can log in manually from there.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: How to make Excel automatically login on a website so it can retrieve data from the si

    It depends on your basic knowledge on how to scrap data from a site.
    This link gives you a pointer.

    http://www.excelforum.com/excel-prog...d-on-date.html
    Last edited by AB33; 11-25-2016 at 05:22 PM.

  3. #3
    Registered User
    Join Date
    11-25-2016
    Location
    Zagreb, Croatia
    MS-Off Ver
    Office 2013
    Posts
    4

    Re: How to make Excel automatically login on a website so it can retrieve data from the si

    Well I know some basic HTML and how to how to find certain elements on the website, but I'm new to Macros in excel and VBA. I tryed to use some VBA code that I found online, and changed the code to my needs, but it always gave me some kind of error that I didn't know how to fix.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: How to make Excel automatically login on a website so it can retrieve data from the si

    Post your code.

  5. #5
    Registered User
    Join Date
    11-25-2016
    Location
    Zagreb, Croatia
    MS-Off Ver
    Office 2013
    Posts
    4

    Re: How to make Excel automatically login on a website so it can retrieve data from the si

    Sub test()
    ' open IE, navigate to the desired page and loop until fully loaded
    Set ie = CreateObject("InternetExplorer.Application")
    my_url = "https://ocjene.skole.hr/pocetna/prijava"

    With ie
    .Visible = True
    .Navigate my_url
    .Top = 50
    .Left = 530
    .Height = 400
    .Width = 400

    Do Until Not ie.Busy And ie.readyState = 4
    DoEvents
    Loop

    End With

    ' Input the userid and password
    ie.Document.getElementById(user_login).Value = "username"
    ie.Document.getElementById(user_password).Value = "password"

    ' Click the "Search" button
    ie.Document.getElementById(submit).Click

    Do Until Not ie.Busy And ie.readyState = 4
    DoEvents
    Loop
    End Sub

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: How to make Excel automatically login on a website so it can retrieve data from the si

    Okay!
    Please use code tags with your code. It is forum's rule.

    Also note that all user name and password values should be in ""

    ie.Document.getElementById("user_login").Value = "username"

    I suspect the code errors on this line

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by AB33; 11-25-2016 at 06:25 PM.

  7. #7
    Registered User
    Join Date
    11-25-2016
    Location
    Zagreb, Croatia
    MS-Off Ver
    Office 2013
    Posts
    4

    Re: How to make Excel automatically login on a website so it can retrieve data from the si

    Well the sumbit button does not have an ID, so I don't know what to do. And besides that, the username and password doesen't enter in the fields either.

  8. #8
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: How to make Excel automatically login on a website so it can retrieve data from the si

    Try this one for login and pass
    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: How to make Excel automatically login on a website so it can retrieve data from the si

    I do not know what this word means "Prijava"

    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: How to make Excel automatically login on a website so it can retrieve data from the si

    You can also use these lines for the submit button.

    Please Login or Register  to view this content.
    Last edited by AB33; 11-26-2016 at 08:02 AM.

  11. #11
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,010

    Re: How to make Excel automatically login on a website so it can retrieve data from the si

    Literal translation: https://gradesschool.hr/initial/signin

    bornacvitanic : Thanks
    Last edited by Logit; 11-26-2016 at 04:55 PM.

+ 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. Create a Macro to automatically login to a website and back to excel.
    By suresh_m in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-15-2013, 01:22 PM
  2. Replies: 0
    Last Post: 07-24-2013, 11:16 PM
  3. Automatic login into website from excel
    By indhrui in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-12-2013, 01:38 AM
  4. Get data from website - connect to site database?
    By Roquete in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-08-2011, 09:05 AM
  5. Excel VBA to login to a secured website
    By Jds3579 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2011, 11:33 PM
  6. Retrieve Data from Web site
    By Les Stout in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2006, 01:10 AM
  7. [SOLVED] Is there a way to copy web site data to excel to make it sortable
    By Jetson2k in forum Excel General
    Replies: 1
    Last Post: 08-30-2005, 10:05 PM
  8. [SOLVED] How do I retrieve data into a cell from a web site?
    By Matty in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-09-2005, 11:06 AM

Tags for this Thread

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