0

I want to fill in a form in VBA. I can fill everything empty field and set the drop down menus. However I couldn't find a way to put a file in the browse button.

browse button

The code for this button is:

enter image description here

I tried something like this

IE.Document.getElementById("browseFiles").Value = "C:\Users\nx\Documents\BCAM development.docx"

or

IE.Document.getElementById("fileElement").Value = "C:\Users\nx\Documents\BCAM development.docx"

As expected it didn't work even though it doesn't give me any error.

Do you know if it is possible to transfer a file like this?

Thank you in advance!

Community
  • 1
  • 1
Jack
  • 695
  • 10
  • 29
  • I'm afraid it's not going to be so simple. I think your best bet would be to find the underlying POST method that is being sent when you upload the file and use a `multipart/form-data` type of encoding for the request's body to include the path of the file. – Stavros Jon Sep 04 '19 at 08:39
  • @StavrosJon mh I see... I will dig into that! Thanks you! – Jack Sep 04 '19 at 08:51
  • Possible duplicate of [How to set a value to a file input in HTML?](https://stackoverflow.com/questions/1696877/how-to-set-a-value-to-a-file-input-in-html) – Jeremy Thompson Sep 05 '19 at 11:36
  • @JeremyThompson No not really there it talks about a normal input box and I am talking about a browse button which more complicated to use programtically... – Jack Sep 05 '19 at 13:21

0 Answers0