Uploading a file to a Webpage(IE11) with Excel Macro Vba

561 Views Asked by At

I'm trying to use the following code to upload a file to a webpage:

WD.document.getElementById("fileUpload").Value = "filepath"

'The code does not came with the property 'value' empty( = "") its just not 'there until i click the buttom "search" 'and use the popup dialog to select a file. 'Also when inserting the value by code, the source code ' returns 'value = ""' and whenever i try again, ' it still gets value = ""

WD.document.getElementById("fileUpload").Click

'The Click fires a windows popup dialog for selecting a file, so its not worthy 'to use it.

WD.document.getElementById("frmUpload").submit

'i can use this command to fire the event of uploading, but with a value = "" 'its going to return the "file not found" popup

'HERES THE SOURE CODE FOR THE SITUATION___________________:

<INPUT id=fileUpload size=48 type=file name=fileUpload>'the element

<FORM id=frmUpload encType=multipart/form-data method=post action=/ChamadoPC/Upload/12295979/1 target=fraUpload jQuery15105169442065138357="118">'the form 

hope you can help me, hope everybody understand!

0

There are 0 best solutions below