I am trying to import the .csv from this URL:
The below code works when I use a different .csv URL, like this one: http://ichart.finance.yahoo.com/table.csv?s=AAPL&d=2&e=13&f=2013&g=d&a=8&b=7&c=1984&ignore=.csv
But the code does not work with the longer URL. Is the URL too long? If so, is there a workaround?
Here is my current code:
Sub importCSV()
Dim URL As String
URL = "TEXT;http://www.redfin.com/stingray/do/gis-search?market=socal®ion_id=11203®ion_type=6&excl_ss=true&hoa=&max_listing_approx_size=&max_num_beds=&max_parcel_size=&max_price=300000&max_year_built=&min_listing_approx_size=&min_parcel_size=&min_price=50000&min_year_built=&num_baths=1.0&num_beds=1&open_house=&pkg=-&rd=&sf=1%2C2%2C3&sold_within_days=&status=1&time_on_market_range=30-&uipt=2&v=8&num_homes=500&sp=t&al=3&render=csv"
Application.DisplayAlerts = False
With ActiveSheet.QueryTables.Add(Connection:=URL, _
Destination:=Range("A1"))
.Name = "test"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Application.DisplayAlerts = True
End Sub
Matt