如何在VBA中执行Javascript函数

我使用电子表格中的值填写networking表单。 表单填写正常,但有一些JavaScript字段validation发生,因为我的代码填充文本框字段没有validation,它是看到我的领域为空。 这是我的VBA代码片段。

Set objCollection = wd.document.getElementsByTagName("input") i = 0 While i < objCollection.Length 'Name If objCollection(i).Name = "Y__0__Cctl1_ctl8_ctl2_6_ctl4__X" Then objCollection(i).Value = Sheets("Main").Range("b4") ' "Hello World" End If 

我已经缩小了onkeypress的Javascript函数,但我不知道如何在VBA中用适当的variables正确地调用它。 这是另一个片段。

 <input name="Y__0__Cctl1_ctl8_ctl2_6_ctl4__X" title="" class="DefaultTextBox DefaultTextBoxMandatory" id="Y__0__Cctl1_ctl8_ctl2_6_ctl4__X" onkeypress="return aeweb_BlurAndCallAssoc( this, 'Y__0__Cctl1_ctl8_ctl2_6_ctl4__X', event);" onblur="aechg(this, event);" type="text" value="Hello World" cursor="01Q0Q0Q1" lastvalue="Hello World" ismandatory="true"> 

任何帮助将不胜感激。

谢谢!