ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA loop is killing me! (https://www.excelbanter.com/excel-discussion-misc-queries/50374-vba-loop-killing-me.html)

Dave Bailey

VBA loop is killing me!
 
Hi,

I am trying to pull in multiple XML feeds into one spreadsheet.

I start the macro and then do the following -

I am using data - XML - Import

After I get to the prompt, I type in http://rss.news.yahoo.com/rss/world and
OK

On the Import Data screen, I go to Properties and check append new data to
existing XML lists and OK

Next, I would like to import another XML list. For example
http://rss.news.yahoo.com/rss/nasashuttle and
http://rss.news.yahoo.com/rss/health.

Can someone send the VBA code that would allow me to do this. Later I can
substitute other URLs.

My current macro does not do this and it would be great to know how to do
this!

Thank you!

Dave

R.VENKATARAMAN

try this sub . copy this in vb editor and run
when the input box comes you can type any one of these
world
nasashuttle
health

or any other item which brings the webpage

this downloads the whole webpage. perhaps there are more elegant ways

code begins

Public Sub test()
ActiveSheet.UsedRange.Clear 'this celars previosu downloaded page
Dim item As String
item = InputBox("type last item")
With ActiveSheet.querytables.Add(Connection:= _
"URL;http://rss.news.yahoo.com/rss/" & item,
Destination:=Range("A1"))
.Name = item
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True

.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With
Range("a1").Select
msgbox "macro over"
End Sub

mine windows 98se excel 2000


--
remove $$$ from email addresss to send email


"Dave Bailey" wrote in message
...
Hi,

I am trying to pull in multiple XML feeds into one spreadsheet.

I start the macro and then do the following -

I am using data - XML - Import

After I get to the prompt, I type in http://rss.news.yahoo.com/rss/world

and
OK

On the Import Data screen, I go to Properties and check append new data to
existing XML lists and OK

Next, I would like to import another XML list. For example
http://rss.news.yahoo.com/rss/nasashuttle and
http://rss.news.yahoo.com/rss/health.

Can someone send the VBA code that would allow me to do this. Later I can
substitute other URLs.

My current macro does not do this and it would be great to know how to do
this!

Thank you!

Dave





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

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