Login to websites from Excel spreadsheet

CoolAuto

New Member
Joined
Aug 26, 2015
Messages
32
On my Excel spreadsheet: web address is in B, username in C, password in D, UN ID in E, PW ID in F, Button ID in G, land page (to go to after logged in) in H. Right click triggers below macro for that particular row. Succeeds in opening address in B, however not seeing log in credentials being put in and gives "Run-time error '5000': Application-defined or object-defined error" on following line:

Code:
Set e = IE.document.getElementById(Range("G" & (ActiveCell.Row)))



Here's the code I have so far:

Code:
Sub PassMASTER()
Dim IE As InternetExplorer
 Set IE = CreateObject("InternetExplorer.application")
    IE.Visible = True
    IE.navigate Range("B" & (ActiveCell.Row))
    Do
        If IE.readyState = 4 Then
            IE.Visible = True
            Exit Do
        Else
          
        End If
    Loop

    
    Application.Wait (Now + TimeValue("00:00:02"))
    
    IE.document.getElementById = Range("E" & (ActiveCell.Row)).Value = Range("C" & (ActiveCell.Row)).Value 'put user name
    
    Application.Wait (Now + TimeValue("00:00:02"))
    
    IE.document.getElementById = Range("F" & (ActiveCell.Row)).Value = Range("D" & (ActiveCell.Row)).Value 'put password

    Dim e As Object

    Set e = IE.document.getElementById(Range("G" & (ActiveCell.Row)))
    e.Click
    
    Application.Wait (Now + TimeValue("00:00:01"))
    
    IE.navigate Range("H" & (ActiveCell.Row))
    
End Sub
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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