没有ID或标签的Vba fire onclick事件

时间:2016-03-21 15:09:01

标签: javascript html vba onclick

我正在尝试使用VisualBasic触发Onclick事件,但是,onclick事件似乎没有任何标记或名称,只有onclick事件本身。因此,我不知道如何解雇它的onclick事件。下面发布的是onclick事件的HTML。我不确定如何创建的代码行是这个appIE.Document.GetElementsByTagName(“?????”)。FireEvent。

Sub GoToWebsiteTest()

Dim appIE As InternetExplorerMedium
Dim objElement As Object
Dim objCollection As Object

Set appIE = New InternetExplorerMedium
sURL = "http://websitename"
With appIE
    .Navigate sURL
    .Visible = True
End With

Application.Wait (Now + TimeValue("0:00:02"))
SendKeys "{ENTER}"

Do While appIE.Busy Or appIE.ReadyState <> 4
    DoEvents
Loop

Set objCollection = appIE.Document.GetElementsByTagName("input")
Set objElement = appIE.Document.GetElementById("menulink33")
objElement.Click

Do While appIE.Busy Or appIE.ReadyState <> 4
    DoEvents
Loop

appIE.Document.GetElementsByTagName("select")("participantId").Value = "XXXXXXXXX"
Set objElement = appIE.Document.GetElementById("searchBtn")
objElement.Click
Do While appIE.Busy Or appIE.ReadyState <> 4
    DoEvents
Loop

Set objElement = appIE.Document.GetElementById("dtcTotalRootInd")
objElement.Click

Do While appIE.Busy Or appIE.ReadyState <> 4
    DoEvents
Loop

appIE.Document.GetElementsByTagName("?????").FireEvent

Do While appIE.Busy Or appIE.ReadyState <> 4
    DoEvents
Loop

End Sub

这是我试图解雇的onclick的HTML。

<a onclick="javascript:app.part.submitLink('D','Activity Balance','470993367.62','565573414.24','94580046.62','P')" href="#">
Activity Balance</a>

我对HTML不太熟悉,如果我能提供更多细节,请告诉我。任何帮助深表感谢。

由于

0 个答案:

没有答案