VBA IE点击button,需要参数?

我正在使用Excel和VBA编程。

我find了一个我想要点击的button。 但是,似乎这个button需要一个参数。

在Chrome中使用控制台,我input了这个:

document.getElementById("button1").click 

该行解决了function click() { [native code] }所以我试着这个:

 document.getElementById("button1").click ('100', '2016-03-02') 

它的工作。 那么,我如何从VBA运行同样的东西呢?

我已经尝试了以下内容:

 Sub ClickTheButton() Dim IE As SHDocVw.InternetExplorer Dim Doc As MSHTML.HTMLDocument Set IE = New SHDocVw.InternetExplorer With IE .Visible = True .Navigate "(webpage here)" Do Until Not .Busy And .ReadyState = 4 DoEvents Loop Set Doc = .Document Doc.GetElementByID("button1").Click ' nothing happens when running this Doc.GetElementByID("button1").Click "('100', '2016-03-02')" ' not working (can't even attempt to run this) Doc.GetElementByID("button1").Click ("'100', '2016-03-02'") ' not working (can't even attempt to run this) End With End Sub 

由于之后的代码,我无法运行该过程.Click返回Wrong number of arguments or invalid property assignments

有任何想法吗?

在这里find答案。

点击button运行一个function。 我可以不用点击button而是像下面这样运行这个函数:

 Dim CurrentWindow As HTMLWindowProxy Set CurrentWindow = IE.Document.parentWindow Call CurrentWindow.execScript("xajax_DoCalReservation('100', '2016-03-02')")