Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Do Loop | Excel Worksheet Functions | |||
Do Loop | Excel Worksheet Functions | |||
Do Loop | Excel Worksheet Functions | |||
VB for excel, how do I loop through code | Excel Discussion (Misc queries) | |||
loop trough e-mail address list to send task lists with outlook | Excel Discussion (Misc queries) |