VBA and IE

Centrican

Board Regular
Joined
Dec 20, 2006
Messages
130
Ok here's my problem - I want to use a VBA excel macro to open up IE and upload files to our corporate intranet site. Now I could do this with sendkeys but of course I don't want to...

My question is; can I use a VB command on a open file window (opened when you click browse to select the file to upload) to go directly to the location and select a file of my choice? If so, what command do I use? I'd imagined using sendkeys to open this window - however it's a named item on the HTML document so I'd guess I can send a variable to it. Do I do this the same way as to a textbox?

I've not built the system yet so don't worry about being vague in responses (the question's pretty vague anyway). Just wondering which direction to take.

Cheers.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
I think this will open IE and navigate to the page you want to go to

Code:
Set ie = CreateObject("InternetExplorer.Application")

With ie
  .Visible = True
  .navigate   "http://www.yourwebsite.com"
[/code]
 
Upvote 0
Yep, that will do that. However it's the code once I've gone to the correct page that I need to know about.

Is there a command to use a named "browse" button on an uploader to open a specific file?
 
Upvote 0

Forum statistics

Threads
1,225,229
Messages
6,183,728
Members
453,185
Latest member
radiantclassy

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