Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Internet Question 1

Status
Not open for further replies.

vzachin

Technical User
Feb 10, 2006
305
US
Hi,

I have a code that goes to a website to download a CSV file. I am stuck at the dialog box that asks me the following question: "Do You Want To Open Or Save This File?". There are 3 buttons: "OPEN","SAVE","CANCEL".
I don't know how to send the <TAB> key to "OPEN" and then <ENTER>.
Is this something real simple?



Code:
     Dim ie As Object
     Dim ieForm As Variant
     Dim WebPage As String
     
     Set ie = CreateObject("InternetExplorer.Application")
     WebPage = "[URL unfurl="true"]http://xxxxxxxxxxxx.CSV"[/URL]
     ie.Visible = True
     ie.Navigate WebPage


thanks
zach
 
You can use SendKeys "{tab}". Alt+O (if it's a hotkey for Open) would be more reliable though.
 
hi Skie,

i'm not having any luck with the SendKeys Method. The send keys just won't function.
i tried the AppActivate method as well but to no avail.
The dialog box i get is "File Download". From here, i can manually Alt+O or Tab to Open, then Enter.
any other ideas?


thanks again
zach
 
i ended up doing this in vba

Code:
Workbooks.Open Filename:= _
        "[URL unfurl="true"]http://xxxxxxxxxxxx.CSV"[/URL]
        ActiveWindow.Visible = False
        Windows("xxxxxxxxxxxx.CSV").Visible = True
[code]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top