+ Reply to Thread
Results 1 to 12 of 12

Retrieving XML data by looping through a range in a column

  1. #1
    Registered User
    Join Date
    06-04-2007
    MS-Off Ver
    Excel 2007
    Posts
    94

    Retrieving XML data by looping through a range in a column

    I have a worksheet that has in one column links to different xml IDs which I can copy the link then choose Data> Get Data From External Sources paste the link in the File Name box and click open and then select ok for the dialogue box and then select the select that I want the information to appear in, but go through many of these in the many is time consuming.

    I have a macro that begins to do what I am doing manually, but would like for the macro to essentially go down the column and repeat the process until it reaches a blank cell then stops.

    Any assistance would be greatly appreciated?

    Here is the process:

    Please Login or Register  to view this content.
    Last edited by capnhud; 01-13-2012 at 10:12 AM.

  2. #2
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Re: Retrieving XML data by looping through a range in a column

    Hi,

    Do you have a copy of the workbook and xml that you can share with us?

    Thanks
    McCrimmon

  3. #3
    Registered User
    Join Date
    06-04-2007
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: Retrieving XML data by looping through a range in a column

    it is company workbook so I am quite sure I cannot post it here

    but the xml is like the following:

    HTML Code: 
    Last edited by capnhud; 01-13-2012 at 09:35 AM.

  4. #4
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Re: Retrieving XML data by looping through a range in a column

    Can you not amend the workbook and XML to dummy data so we know what we are working with?

    It is easy enough to write some code to loop through your workbook, however, need to know what the key is for retrieving the XML items.

    Cheers

  5. #5
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Re: Retrieving XML data by looping through a range in a column

    Does Column A have the XML Link?

    Such as "http://domain.com/cgi-bin/site/xml/itemResponse.w?items=AS31"

  6. #6
    Registered User
    Join Date
    06-04-2007
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: Retrieving XML data by looping through a range in a column

    Yes A2 has the XML Link

  7. #7
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Re: Retrieving XML data by looping through a range in a column

    I am using a different version of Excel from you and do not really know much about the XML Import, however, from looking at your code this should do what you are after?

    Please Login or Register  to view this content.
    Last edited by mccrimmon; 01-13-2012 at 10:05 AM. Reason: Typo

  8. #8
    Registered User
    Join Date
    06-04-2007
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: Retrieving XML data by looping through a range in a column

    Thank You mccrimmon for your assistance

    Yes I am using Excel 2007

    the results of the macro produce

    Run-time error '1004'
    Method 'Range' of object '_Global' failed when I push debug the problem line is highlighted:

    Please Login or Register  to view this content.
    Last edited by capnhud; 01-13-2012 at 10:00 AM.

  9. #9
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Re: Retrieving XML data by looping through a range in a column

    Apologies.
    I had a typo in my code.

    Try again please.

  10. #10
    Registered User
    Join Date
    06-04-2007
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: Retrieving XML data by looping through a range in a column

    You may not know much about XML import but you got this to do what I wanted it to do. Thank you so very much.

  11. #11
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Re: Retrieving XML data by looping through a range in a column

    No worries.

    Please mark thread as solved.

  12. #12
    Registered User
    Join Date
    06-04-2007
    MS-Off Ver
    Excel 2007
    Posts
    94

    Re: Retrieving XML data by looping through a range in a column

    Quote Originally Posted by mccrimmon View Post
    No worries.

    Please mark thread as solved.
    Not sure how I missed not marking it as solved but the forum will not let me mark it as solved

+ 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