ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Get External Data/From Web (https://www.excelbanter.com/excel-discussion-misc-queries/245932-get-external-data-web.html)

NewMoon1918

Get External Data/From Web
 
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?


muddan madhu

Get External Data/From Web
 
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


On Oct 20, 6:09*am, NewMoon1918
wrote:
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?



NewMoon1918

Get External Data/From Web
 


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.





All times are GMT +1. The time now is 10:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com