Question on automatic access to a website with a popup login

bismark80

New Member
Joined
Sep 1, 2010
Messages
2
I've been trying to figure out how to automate my access to a website that requires a popup login. The problem is that before you even reach the site a popup comes up for you to log in. This popup in the code the site still appears busy as it doesn't move forward until something is done with the popup, and it also prevents you from control the popup with your ie control.

Here is what I have so far:

Code:
Sub LoginSite()
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
' Go to login page
.Navigate "[URL="https://emkt.pjm.com/emkt/generatorMarketResults/generatorMarketResults.do?method=view"]https:website[/URL]"
 
 
' Loop until the page is fully loaded
' This is where I get a popup. Not sure what to do here 
' in order to enter the username and password and 
' click okay to get into the website.
 
Do Until .ReadyState = 4
DoEvents
Loop
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
It's difficult to help without knowing the URL. In general, there are 2 ways of getting an IE reference to the pop-up window:

1. Loop through Shell.Windows looking for the IE object associated with the pop-up.
2. Use InternetExplorer WithEvents and catch the creation of the pop-up window in the NewWindow2 event.
 
Upvote 0
Are you being redirected from the page you are trying to navigate to?

If you are you might be able to navigate straight to the popup, or at least get it's URL.

Really depends on the site though, and as John says, the URL is kind of handy to check that kind of thing.:)
 
Upvote 0
Thanks for your help/your replies. I apologize, I should have included a website, since teh question didn't provide much context :).

The website I'm trying to access is https://emkt.pjm.com/emkt/

If you click on it, you'll see the login page that I get to. It doesn't redirect me anywhere, but just waits for authentication.
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,486
Members
452,917
Latest member
MrsMSalt

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