这是我通过宏自动化尝试做的事情->
-> 我正在尝试打开网站 [url]http://www.metaboanalyst.ca/MetaboAnalyst/faces/Home.jsp[/url]
-> 然后点击“点击这里开始”
-> 然后检查“峰值强度表”的单选按钮
-> 然后点击“浏览”数据文件并手动选择一个文件(需要选择的文件)。
-> 然后最后单击提交按钮(单击提交按钮时该按钮不起作用并且文件路径消失并给我一个自动化错误 ['-2147352319 (80020101)'])
这是工作正常的代码,除了提交的最后一步->
Sub MetaboAnn()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://www.metaboanalyst.ca/MetaboAnalyst/faces/Home.jsp"
Do Until IE.ReadyState = 4
DoEvents
Loop
Application.Wait (Now + TimeValue("0:00:05"))
'MsgBox "Done"
IE.Visible = True
IE.Document.getElementById("form1:groupPanel1:loginLink").Click
Application.Wait (Now + TimeValue("0:00:05"))
'MsgBox "Done"
IE.Visible = True
IE.Document.getElementById("form1:tabSet1:tab1:layoutPanel7:csvButtonGroup:csvButtonGroup_2_rb").Click
Application.Wait (Now + TimeValue("0:00:03"))
'MsgBox "Done"
IE.Visible = True
IE.Document.all("form1:tabSet1:tab1:layoutPanel7:statCsvUpload_com.sun.webui.jsf.upload").Click
Application.Wait (Now + TimeValue("0:00:03"))
'MsgBox "Done"
IE.Visible = True
IE.Document.getElementById("form1:tabSet1:tab1:layoutPanel7:csvSubmitButton").Click
End Sub