Basically my requirement is to download the excel file from webpage through vba. I have written the code to login but unable to click on the list item. I need to iterate the loop through class and then list and tag a. So help me how can iterate through multiple option with vba.
I have attached the HTML source code i need to access hourly report from first list under Ul tag.
Sub DownloadIntraDayReport()`
Dim ie As New InternetExplorer
ie.navigate "weblink"
ie.Visible = True
While ie.Busy DoEvents Wend
Do Loop Until ie.readyState = READYSTATE_COMPLETE
Set HTMLDoc = ie.document
ie.document.getElementById("_58_login").Value = "username"
ie.document.getElementById("_58_password").Value = "password"
'ie.document.form().submit
For Each MyHTML_Element In HTMLDoc.getElementsByTagName("input") If MyHTML_Element.Type = "submit" Then MyHTML_Element.Click
Next
End Sub
Image of page and HTML
