PDA

View Full Version : Open and Hyperlink in IE and Save as HTML



uaku
08-09-2011, 09:50 AM
Hello,
I have few financial reports that I want to download to my local disk. I manage to open the page and save as mht through below code. I would like to
Save this as html and also give my own name to the file thats being saved so that I won't get the overwrite message everytime.
In the code below it shows only one link, if I can save that as html and give it a name then I can put it in a loop to get others.
Thanks for your :help
Aku

Sub TESTING()
'Need to reference to Microsoft Internet Controls
Dim URL As String
'URL = Worksheets("References & Resources").Range("URLMSL")
URL = "http://www.sec.gov/Archives/edgar/data/80424/000119312511116981/d10q.htm" 'for TEST
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = True
ie.Navigate URL
Do While ie.ReadyState <> 4
DoEvents
Loop
SendKeys "%S"
ie.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_DODEFAULT 'SaveAs

ie.Quit

End Sub