troubleshooting Question

Excel VBA Internet Explorer navigation, execScript launches a save file window but how do I hit save file as?

Avatar of Tester454
Tester454 asked on
Microsoft Excel
2 Comments1 Solution1211 ViewsLast Modified:

I have been using Excel VBA to navigate through a webpage. Using VBA, I am able to login to a site and navigate to the correct page and then using execScript, launch the save file window, but I am having trouble finding the code to hit save file as and rename the file.

The VBA code that I use which launches the save file window is below. I don't have a direct link to the file at all and have to use this execScript to launch the file.

 Call IE.document.Frames(1).document.parentWindow.execScript("XLSFile();", "JavaScript")

It brings up the window, Do you want to open or save R3668_2012211422.csv" from ? Then the options "Open",  "Save" and "Cancel". (I can click on the arrow next to save to bring up the save as option as well)

I am having trouble figuring out how to use Excel VBA code to click save as and then type in the file name I want to save it as, most of the information I can find online requires a direct link to the file.

Let me know if you need more information or have any questions about what I am trying to do.

Thanks so much.
NorieAnalyst Assistant
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros