在Javascript Popup上单击“确定”的VBA代码

时间:2017-09-06 02:08:55

标签: javascript vba

我自动使用VBA脚本在网页上输入信息。在我到达网页上的代码的这一部分之前,我做得很好:

class ChildPage(Page):
    parent_page_type = ['my_app.HomePage']

我可以在原始网页上执行 var message = "You must read and accept these terms .\n\n"; if(index < 10) var response = confirm(message); if (response==true) {frm.h_index.value = index; frm.submit(); return true;} else return false; 函数,然后运行此弹出窗口。从这里开始,我的代码无法执行任何操作,直到我在Javascript弹出窗口中手动单击“确定”。我尽我所能搜索,但仍不确定如何处理。

如何以编程方式关闭Javascript弹出窗口?

1 个答案:

答案 0 :(得分:0)

首先需要搜索弹出窗口,然后必须将.click发送到该特定的IE对象。请找到您可以使用的示例函数和Sub。在下面的代码中,您需要在找到iePopup对象后发送.click。

SELECT
    product,
    sub,
    COUNT(*)
FROM table1
GROUP BY
    product,
    sub
HAVING COUNT(*) > 1;