Parsing XML with branches to a single row in Excel

24 views
Skip to first unread message

David Scott Stokes

unread,
Nov 4, 2013, 4:24:10 AM11/4/13
to excel-r...@googlegroups.com
Hi,
restQuery returns data simplified to:
 <FundDetail>
   <TFN>
        .....
       <PhysicalAddress>
      <AddressLine1>
      <AddressLine1>
        </PhysicalAddress>
 </FundDetail>

The plan was to run
restQuery several times with results variations to populate both the tree ( library .add "results", "FundDetail") and the branches (library  .add "results", "FundDetail.PhysicalAddress").
However, in Excel 2010 this results in a VBA message: Run-time error "457". This key is already associated with an element of this collection.

I guess that this is due to having the same Request URL as all other parameters except user and password differ.
Even after deleting every component added to run .add "results", "FundDetail.PhysicalAddress", the message persists and now makes the original macro fail. Restarting Excel does not work. A complete system reboot is coming up next.
(Q1) is this due to using the library and should I construct the queries without using the library?
(Q2) is there a way to avoid the failure with some elegant coding?



Bruce McPherson

unread,
Nov 4, 2013, 5:06:18 AM11/4/13
to excel-r...@googlegroups.com
You can only have one library entry per name, do you have a duplicate name?

Sent from my iPad
--
You received this message because you are subscribed to the Google Groups "Excel Liberation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excel-ramblin...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

David Scott Stokes

unread,
Nov 4, 2013, 5:18:52 AM11/4/13
to excel-ramblings
Hi Bruce,
There was only a duplicate name for a moment as I copied the original down, changed the name and then ran the VBA. There was no duplicate name when the VBA REST request was run.

 Regards
 
David SCOTT STOKES
Chartered Accountant FCA PMP
david.sco...@inman.com.au    www.inman.com.au
+61 417 531107 in Australia and global roaming


--
You received this message because you are subscribed to a topic in the Google Groups "Excel Liberation" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/excel-ramblings/DTDI5W9FjaI/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to excel-ramblin...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages