(Solved) – VBA automatic login to website with sheet/cell reference


I have this code:

    Set txtUserName = IE.Document.getelementbyid("txtUserName")
    txtUserName.Value = "xxxxxxxxxxx"
    Set txtPassword = IE.Document.getelementbyid("txtPassword")
    txtPassword.Value = "yyyyyyyyyyy"

It works perfectly fine, but what I would like to achieve is the following.
Instead of entering the username and password in the code itself, I would like to refer those to Sheet1, Cell B2 (for username) and Sheet1, Cell B3 (for password)
I tried several methods but I am not able to find a solution.
Can you help me please?
Thanking you in advance.

Leave a Reply

Your email address will not be published. Required fields are marked *