ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automate IE right-click "Save Target As..." (https://www.excelbanter.com/excel-programming/387201-automate-ie-right-click-save-target.html)

matt

Automate IE right-click "Save Target As..."
 
Anyone who might know:

I am able to do limited work in automating IE via VBA. I am able to
navigate to a website, select radio and option buttons, click links,
and submit a form. If the form returns the request as HTML within the
IE window I can pull off the information from IE and dump it into
Excel. (I use something like "SetText ie.document.innerHTML" and then
pull it off the clipboard).

The website that I'm now accessing requires a username and password.
I can get into the site via VBA and navigate to where I want and
submit the form; however, my data now comes over according to a
selected option. I can select the output as *.txt or *.csv. Since
the website does not automaticaly load the data into the IE window as
HTML I can't simply use the .innerHTML option.

If I select the *.txt or *.csv output option and submit the form the
output is returned in the IE window as a link. I can then
programmatically click the link.

If the output option is *.txt and I click the link, the text file is
opened in the IE window. However, because it does not have a HTML
format I cannot use .innerHTML to copy the data over.

How can I programmatically get the text off of IE and into Excel?

Additionally, I'm wondering how to programmatically right-click the
link and select the "Save Target As..." option. I could select the
output option as *.csv and then save the target. I could then use VBA
to then open the *.csv file and copy the data over. Since the website
requires a username and password a simple Workbooks.Open
Filename:=http:... will not work.

How can I programmatically perform the right-click "Save Target As..."
option via VBA?

Thanks in Advance,

Matt



All times are GMT +1. The time now is 09:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com