Internet Explorer Username & Password

rprosser

New Member
Joined
Sep 28, 2006
Messages
10
Good morning,

I currently I have a macro that goes out to a website and logs in using the send keys but I would like to modify the macro to login using the username and password value in the source code instead of the send keys. However, I’m just starting to learn how to use VBA to communicate with Internet Explorer and I’m not sure how to do it.

Can someone please navigate to https://appraisalport.com/ and view the source code and let me know if you can come up with a way to post a value to the username and password field? If you can give me the base code, I should be able to figure out the rest.

Also, does anyone know of a good book that I can get to learn how to use VBA to communicate to Internet Explorer?


If you have any questions or need additional information, please let me know and I’ll respond right away.

Thanks,

Rick
:biggrin:
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,303
Office Version
  1. 365
Platform
  1. Windows
Rick

Here's a start.
Code:
'https://www.appraisalport.com/
Sub Test()
    Set ie = CreateObject("InternetExplorer.application")
    ie.Visible = True
    ie.navigate ("https://www.appraisalport.com/")
    Do
        If ie.readyState = 4 Then
            Exit Do
        Else
            DoEvents
        End If
    Loop
    Set doc = ie.document.frames("header").document
    
    Set ctl = doc.getElementById("txtUserID")
    
    ctl.Value = "UserID"
    
    Set ctl = doc.getElementById("txtPassword")
    
    ctl.Value = "Password"
    
    doc.forms(0).submit

End Sub
 

rprosser

New Member
Joined
Sep 28, 2006
Messages
10
Thanks so much!

It worked perfect! Thanks so much for the quick response. One last question for you. Do you know of any good book so resources that would help me learn how to communicate to Internet Explorer using VBA?

Thanks again,

Rick
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,303
Office Version
  1. 365
Platform
  1. Windows
Rick

I don't know of any book.

But I've found this <a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/dhtml_reference_entry.asp
">link</a> useful.
 

rprosser

New Member
Joined
Sep 28, 2006
Messages
10
You have been a great help! I sure appreciate you taking the time to answer my questions and providing the link.

Rick


:biggrin:
 

Forum statistics

Threads
1,141,098
Messages
5,704,319
Members
421,338
Latest member
Pepess

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top