Upload a file to a web page with VBA

Juan Fonseca

New Member
Joined
Apr 4, 2021
Messages
3
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Platform
  1. Windows
  2. Web
Best regards to everyone, I am trying to automate the process of uploading some documents to a web platform.

I already know how to click on the "browse" button that appears on the page to upload the files knowing its ID (I use IE.document.getElementById ("Browse_Button"). Click), but here a window opens to search and select the file to upload; and it is at this point where I do not know how to automate the search for the document (I already have the path saved in a string filepath) within the window that opens and finally click on the "upload file" button of said window.


I appreciate you could help me with the part of the code and / or the explanation of the commands to manage it within this search window.
1617557341481.png
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
You can upload a file using VBA by automating the web page's HTML form with IE:


Look in the HTML for the form with an input tag of type=file to determine the field name you must specify in the Content-Disposition header.
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,361
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top