Enter Username & Password into pop-up window on Web Page

j844929

Active Member
Joined
Aug 18, 2002
Messages
423
Hi,

I have successfully entered Usernames and Passwords into all sorts of websites, but I'm a bit stuck on this one. When you navigate to the URL, A pop-up window appears asking for a Username and Password entry. I have tried the following, but it didn't work and now I'm left scratching my head. The URL is provided in the code.

Code:
Sub Login_To_Website()
Set myIE = CreateObject("InternetExplorer.Application")
myIE.Navigate URL:="https://www.toga.ngtuk.co.uk/toga"

On Error Resume Next
AppActivate "Connect to www.toga.ngtuk.co.uk", 1
 
           Do Until .ReadyState = 4
            DoEvents
        .Visible = True
            With .Document.forms("Connect to www.toga.ngtuk.co.uk")
                .USER.Value = "Username"
                .Password.Value = "Password"
                .submit
            End With

End Sub

[code]

Can anyone provide a solution that actually works?

Any help on this would be greatly appreciated.

Tim
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
The pop-up login window isn't a HTML form, so setting and submitting the form fields won't work.

This type of pop-up window is displayed in response to user name and password authentication required by the web server. You could try the technique shown in http://www.mrexcel.com/forum/showthread.php?t=442354 (last code posted is the best).

Failing that, using FindWindow and probably other functions from the Windows API to find and populate each part of the login window (user name input field, password input field, OK button) might work.
 
Upvote 0

Forum statistics

Threads
1,214,544
Messages
6,120,126
Members
448,947
Latest member
test111

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