VBA IE Automation - Clicking Browse Files Button

L

Legacy 185660

Guest
Hi!
So I'm currently creating some VBA to automate IE, I have VBA to open a webpage, insert data, and it all works fine. To make it better, I also want to automate file uploads where VBA fills out the entire form, then presses the button to get the select files dialog for the user to enter in the files.

I've tried for hours, but I can't figure out how to click the button.

Any ideas?

Since I can't paste HTML here without it messing up the actual post, the code is:
http://dl.dropbox.com/u/66903141/HTML Button.txt

and if that can;t be done, the secondary choice is to click this button (although I'd prefer the first way):

< input type="file" name="u" size="40" style="width:500px" / > (i've added spaces so it will display the HTML code)
 
Last edited by a moderator:

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Since I can't paste HTML here without it messing up the actual post, the code is:
http://dl.dropbox.com/u/66903141/HTML Button.txt
The HTML should post correctly if you put it inside HTML tags. That HTML is a Flash uploader; I don't think I've seen any code to automate this type of upload and I would need to see the entire HTML and the web page itself to say more.

and if that can;t be done, the secondary choice is to click this button (although I'd prefer the first way):
HTML:
<input type="file" name="u" size="40" style="width:500px" />
See Automated file upload using IE, without user interaction - VBA and Automatic file upload using IE+ADO without user interaction - VBSscript. Basically, you have to build the multipart/form-data string including the file bytes and send the whole lot in a HTTP POST request.
 
Upvote 0
The HTML should post correctly if you put it inside HTML tags. That HTML is a Flash uploader; I don't think I've seen any code to automate this type of upload and I would need to see the entire HTML and the web page itself to say more.
Kijiji : Post an Ad
There it is! I think it would be enough if I could just click the button and allow for use input.

See Automated file upload using IE, without user interaction - VBA and Automatic file upload using IE+ADO without user interaction - VBSscript. Basically, you have to build the multipart/form-data string including the file bytes and send the whole lot in a HTTP POST request.
Kijiji : Post an Ad
I was looking at that yesterday for a while, but I couldn't figure out how to actually create the entire HTTP post request. I couldn't find any other examples
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,730
Members
448,987
Latest member
marion_davis

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