Secure Login



Public Sub SecureLogin() 
     
    Const strURL_c As String = "https://www.fame8.com/fame/UI/Pre_login.aspx?epyt=1" 
    Const strUsr_c As String = "myUserID" 'this is where i set my UserID
    Const strPwd_c As String = "myPassword" 'this is where i set my password
     
     
    Dim objIE As SHDocVw.InternetExplorer 
    Dim ieDoc As MSHTML.HTMLDocument 
    Dim tbxPwdFld As MSHTML.HTMLInputElement 
    Dim tbxUsrFld As MSHTML.HTMLInputElement 
    Dim btnSubmit As MSHTML.HTMLInputElement 
     'Create Internet Explorer Object
    Set objIE = New SHDocVw.InternetExplorer 
     'Navigate the URL
    objIE.Navigate strURL_c 
     'Wait for page to load
     
    Do Until objIE.ReadyState = READYSTATE_COMPLETE: Loop 
         'Get document object
        Set ieDoc = objIE.document 
         
         'Get username/password fields
        objIE.Visible = True 
         
        Set frm = ieDoc.frames(0).document.forms 
         
        Set tbxUsrFld = frm(0).all.Item("txtUserId") 
        Set tbxPwdFld = frm(0).all.Item("txtPassword") 
        Set btnSubmit = frm(0).all.Item("submit") 
         
         'Fill Fields
        tbxUsrFld.Value = strUsr_c 
        tbxPwdFld.Value = strPwd_c 
         
         'submit form
        frm(0).submit 
         
         'Wait for page to load
        Do Until objIE.ReadyState = READYSTATE_COMPLETE: Loop 
             
        End Sub 
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: