VBA - Handle Javascript Pop Up With IE Automation
I have automated my Internet Explorer to fill out a lot of information throughout the webform. When my VBA script clicks the transfer htmlelement it runs the Javascript which opens
Solution 1:
You can try something like this:
Dim el, f
Set HTMLDoc = ie.document
Set el =HTMLDoc.getElementById("ctl00_PlaceHolderMain_TestControl1_" & _
"CertificateSearchControl_cmdTransfer")
f = el.onclick
f = Replace(f, "return confirmOnTransfer();", "")
el.onclick = f
el.click
Part 2 (4/1/2015):
Dim el2
'get the div containing the menu options
Set el2 = HTMLDoc.getElementById( _
"ctl00_PlaceHolderMain_TestControl1_Certificate" & _
"SearchControl_CertificateBundleReport_ctl05_ctl04_ctl00_Menu")
'click one of the contained links in that div
el2.getElementsByTagName("a")(1)
Post a Comment for "VBA - Handle Javascript Pop Up With IE Automation"