+ Reply to Thread
Results 1 to 2 of 2

VBA loop is killing me!

  1. #1
    Dave Bailey
    Guest

    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. #2
    R.VENKATARAMAN
    Guest

    Re: VBA loop is killing me!

    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" <[email protected]> wrote in message
    news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1