使用VBA在网站中自动上传文件路径

时间:2017-07-05 00:02:18

标签: vba excel-vba file-upload sendkeys excel

我试图通过将文件路径提供到field2来从我的机器上传文件。但它不工作。我正在使用VBA excel.Below是该网站页面的截图。请帮助。提前谢谢。

website screenshot1

website screenshot1

website screenshot2

website screenshot2

fileuploader的HTML代码

<&#;输入id =" field2" title ="上传文件" MAXLENGTH =" 30"大小=" 25"名称=" FIELD2" value ="选择一个文件"类型="文件">

以下是我的VBA代码

objIE.document.getElementById("activityText").Value = " this is for activity textbox" 
objIE.document.getElementById("field1").Value = " this is for description text box" 
'for below click event, file upload popup is coming but unable put file path
objIE.document.getElementById("field2").Click

objIE.document.all.field2.Focus()

Set objShell = CreateObject(Wscript.Shell)

objShell.SendKeys ("C:\User\filename.zip")

0 个答案:

没有答案