-
Ken
Have you considered automating IE?
Here's an example:
[vba]
Sub Test()
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate "http://data.bls.gov/cgi-bin/srgate"
Do Until .ReadyState = 4: DoEvents: Loop
Set myTextField = .document.all.Item("series_id")
myTextField.Value = "ECU11121I"
ie.document.forms(0).submit
Do Until .ReadyState = 4: DoEvents: Loop
Do While .busy: DoEvents: Loop
Set doc = ie.document
GetAllTables doc
.Quit
End With
End Sub
Sub GetAllTables(d)
For Each e In d.all
If e.nodename = "TABLE" Then
Set t = e
tabno = tabno + 1
nextrow = nextrow + 1
Set rng = Range("B" & nextrow)
rng.Offset(, -1) = "Table " & tabno
For Each r In t.Rows
For Each c In r.Cells
rng.Value = c.innerText
Set rng = rng.Offset(, 1)
I = I + 1
Next c
nextrow = nextrow + 1
Set rng = rng.Offset(1, -I)
I = 0
Next r
End If
Next e
End Sub[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules