1. Welcome to Chandoo.org Forums. Short message for you

    Hi Guest,

    Thanks for joining Chandoo.org forums. We are here to make you awesome in Excel. Before you post your first question, please read this short introduction guide. When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there first language and we need to allow for this in our dealings.

    Yours,
    Chandoo
  2. Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  3. When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Input Username & Password from Cell A1 & A2 on website

Discussion in 'VBA Macros' started by Bipin619, Dec 5, 2018.

  1. Bipin619

    Bipin619 New Member

    Messages:
    26
    Code (vb):
    Sub test()
    ' open IE, navigate to the desired page and loop until fully loaded
       Set IE = CreateObject("InternetExplorer.Application")
        my_url = "https://services.gst.gov.in/services/login"

        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 username and password
       IE.Document.getElementById("user_name").Value = "testID"
        IE.Document.getElementById("user_pass").Value = "testPW"

        Do Until Not IE.Busy And IE.readyState = 4
            DoEvents
        Loop
    End Sub
    I want text of cell A1 and Cell A2 instead of predefined name.
    Last edited: Dec 5, 2018
  2. Ajesh

    Ajesh Active Member

    Messages:
    153
    Not worked with IE but this should work. Adjust sheet name as per your need:

    IE.Document.getElementById("user_name").Value = ThisWorkbook.Sheets("Sheet1").Range("A1").Value
    IE.Document.getElementById("user_pass").Value = ThisWorkbook.Sheets("Sheet1").Range("A2).Value

    BR/Ajesh
  3. Ajesh

    Ajesh Active Member

    Messages:
    153
  4. Bipin619

    Bipin619 New Member

    Messages:
    26
    It's not working. It says 'syntax error' marking second line red.

Share This Page