javascript - Handle Pop-Up While Navigating with IE -
i have excel vba macro
- opens ie,
- navigates medicare website,
- logs me in,
- compares claims listed on website in workbook
- alerts me differences
it during log-in step have problem, i've reproduced portion of code below. .click
line executed pop-up window appears asking user click ok button in order proceed. macro execution suspended until manually click ok button on pop-up.
the source code behind http://www.mymedicare.gov web page has information relative pop-up, haven't been able figure out how use can programmatically click pop-up ok button.
any in terms of figuring out how programmatically click pop-up's ok button appreciated.
note: purpose of question, user id , password can used. if handle pop-up you'll passed page says incorrect user id / password.
that indicate you've been successful in handling pop-up.
sub medicare_claims()' ' update status bar application.statusbar = "running medicare claims subroutine" ' open "mymedicare web page set ie = createobject("internetexplorer.application") ie .visible = true .navigate "https://www.mymedicare.gov/" end ' loop until page loaded until ie.readystate = 4 , not ie.busy doevents loop ' log-in ie.document.all.item("ctl00_contentplaceholder1_ctl00_homepage_sweusername").value = "abcde" ie.document.all.item("ctl00_contentplaceholder1_ctl00_homepage_swepassword").value = "12345" ie.document.getelementbyid("ctl00_contentplaceholder1_ctl00_homepage_signin").click ' loop until page loaded until ie.readystate = 4 , not ie.busy doevents loop application.wait (now + timevalue("0:00:15")) ' navigate further search claims" web page ie.navigate "https://www.mymedicare.gov/searchclaims.aspx"
try application.sendkeys "{enter}", true
after login code.
also, try adding do: doevents: loop until not objie.busy
, do while objie.readystate <> 4: doevents: loop
time need page load. in experience, coupling 2 works pretty well, whereas using 1 or other can produce errors , using application.wait
can slow down code unecessarily.
Comments
Post a Comment