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

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
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
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
You have been a great help! I sure appreciate you taking the time to answer my questions and providing the link.

Rick


:biggrin:
 
Upvote 0

Forum statistics

Threads
1,214,592
Messages
6,120,433
Members
448,961
Latest member
nzskater

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
Back
Top