简体   繁体   中英

Control Open/Save/Save As Dialog Box at Internet Explorer via VBA

I am currently working on VBA code to automatically interact with web page with prices. I managed to get to the point where I can get to web page where to download files(in csv format) and also identify DOM - element objects on which Click method needs to be called . The files cant be accessed by the URL (they probably dont event exist as click on elements runs the javascript code). If I click on them, the Open/Save/Save in IE window appears. I would like to know how to select automatically one of the options (Open,Save and Save As) in there (I tried to send the keys but it somehow didnt work).

Parts of your question are quite unclear but I'll do my best to help. While I'm not sure how you'd go about selecting an option from the dialog box, you might be able to examine the javascript to find out what it's doing and use the following script execution ability to recreate the required functionality of part of that js, ie the part that decides where to look for the files you want.

objIE.Document.parentWindow.ExecScript "alert('yep, it worked!')"

Of course, you could write an entire .js file, import it using the FileSystemObject (or otherwise) and run it all using ExecScript.

Hope that helps :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM