Get External Data/From Web

N

NewMoon1918

I am having problems pulling data from the web into Excel 2007. The data in
question can be found at the following site:

http://www2.fdic.gov/closedsales/LoanSales.asp

As a point of reference, I ran a search of data from 8/1/09 through 8/31/09
at that location and the website produced a data table that I attempted to
bring into excel 2007 by going to Data/Get External Data/From Web. When I
pull it into excel, it pulls the following prompt (which can be found at the
bottom of the initial website noted above:

"For sales with offices other than Dallas - Field Office Branch (FOB) please
refer questions to Dallas-FOB. See "Loan Sales FAQ" for contacts. "

Any idea what I am doing wrong?
 
M

muddan madhu

try this

Sub web()

Dim ie As InternetExplorer
Dim tbl
Dim tbls

Set ie = CreateObject("Internetexplorer.application")
ie.Visible = True

URL = "http://www2.fdic.gov/closedsales/LoanSales.asp"

ie.Navigate URL

Do While ie.ReadyState <> 4 Or ie.Busy = True
DoEvents
Loop

Set mindt = ie.Document.getelementsbyname("MinDate")
Set maxdt = ie.Document.getelementsbyname("MaxDate")

mindt.Item(0).Value = "8/01/2009"
maxdt.Item(0).Value = "8/31/2009"

Set fnd = ie.Document.getelementbyid("Action")
fnd.Click

Do While ie.ReadyState <> 4 Or ie.Busy = True
DoEvents
Loop


Set shtn = Sheets("sheet1")
Rng = shtn.Cells(Rows.Count, "C").End(xlUp).Row
Set tbl = ie.Document.getelementsbytagname("Table")

ie.ExecWB 17, 0
ie.ExecWB 12, 0

shtn.Range("A" & Rng).Select
ActiveSheet.Paste

ie.Quit
End Sub
 
N

NewMoon1918

In response to muddan madhu's post above, I appreciate your thoughts however
I don't really understand what it is you are asking me to do. Apparently my
knowledge of Excel isn't what I thought it was. Can you dumb it down for me
or spell it out step by step? Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top