ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pull rss feeds into excel (https://www.excelbanter.com/excel-programming/366088-pull-rss-feeds-into-excel.html)

[email protected]

pull rss feeds into excel
 
I'm trying to find a way to pull rss feeds into excel, and attempting
to use querytable.add to do so. What I'm finding is that it's possible,
but that all of the "columns" of the feed are returned. I'd only like
to see a few of the columns. I'm wondering if the sqlstring: concept
will work for the querytable object, or if there might be another way
to specify which columns to return. Any feedback would be much
appreciated.



Sub rssY()
Dim qt As QueryTable
Dim j As Integer
Dim tickerstring, connectstring, sqlstring As String

tickerstring = localconcat(Range("tickers"), ",")
connectstring = "URL;http://finance.yahoo.com/rss/headline?s=" &
tickerstring
' sqlstring = "select () from /rss" (can't figure out how to make this
work)

With ActiveSheet.QueryTables.Add(Connection:=connectstr ing,
Destination:=ActiveSheet.Range("tickers").Offset(0 , 3)) ',
Sql:=sqlstring)
.Name = "R1"
.RefreshStyle = xlOverwriteCells
.WebSelectionType = xlSpecifiedTables
.AdjustColumnWidth = False
.TextFileStartRow = 10
.Refresh
End With

End Sub



All times are GMT +1. The time now is 06:15 PM.

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