I have asked this question a few times but i dont feel i have acheieved what i want. Several people on here kindly provided assistance but i still have the problem of using the data as its not in usable format.
I would like the contents of the link on the website put into an worksheet, via VBA
The link is on the the top right hand side of the web page.
The link is
http://bmreports.com/servlet/com.logica.neta.bwp_PanBMDataServlet
Code so far:
Set ie = CreateObject("InternetExplorer.Application")
ie.Navigate "http://bmreports.com/servlet/com.logica.neta.bwp_PanBMUTop"
ie.Visible = True
Do Until Not ie.Busy And ie.readyState = 4
DoEvents
Loop
ie.Document.getelementbyid("param5").Value = "2014-04-16"
ie.Document.getelementbyid("param6").Value = "43"
ie.Document.getelementbyid("go_button").Click
Set objShell = CreateObject("Shell.Application")
IE_count = objShell.Windows.Count
For x = 0 To (IE_count - 1)
On Error Resume Next ' sometimes more web pages are counted than are open
my_url = objShell.Windows(x).Document.Location
my_title = objShell.Windows(x).Document.Title
If my_url Like "http://bmreports.com/servlet/com.logica.neta.bwp_PanBMDataServlet" Then
Set ie = objShell.Windows(x)
Exit For
Else
End If
Next
For Each ele In ie.Document.getElementsByTagName("span")
If ele.innerhtml = "Current data in CSV format" Then
DoEvents
ele.Click
'At this point you need to Save the document manually
' or figure out for yourself how to automate this interaction.
End If
Next
If my_url Like "about:blank" Then
Set ie = objShell.Windows(x)
Else
End If
table_html = ie.Document.getElementsByTagName(("Text"))(2).innerhtml
html_lines = Split(table_html, Chr(10), -1, vbTextCompare)
Worksheets("Sheet1").Activate
Range("A1").Select
For x = 0 To UBound(html_lines)
ActiveCell = html_lines(x)
ActiveCell.Offset(1, 0).Select
Next