+ Reply to Thread
Results 1 to 3 of 3

XML import does not always show headers

  1. #1
    Registered User
    Join Date
    04-09-2010
    Location
    Amsterdam
    MS-Off Ver
    Excel 2003
    Posts
    2

    Unhappy XML import does not always show headers

    Hey guys,

    I have been struggling with this problem for a while and hope that you can help me solve this.

    I have written a web service that returns well formed XML including schema etc. I verified both the XML and the schema and they are both fine.
    Within Excel, I am importing this XML using
    ThisWorkbook.XmlImport url, Nothing, True, worksheet.Cells(1, 1)

    So far no problem, I can import the data and it is displayed properly.

    The only issue is that if there is only one object (or row) in the XML, the nicely formated headers that allow filtering etc disappear! However, I do need those headers in my sheet (especially since I want to know what data is being displayed in the column).

    I assumed that Excel would parse the schema and see where my maxOccurs are unbounded to understand that there would be multiple elements. It does not, apparently.

    If anybody could help me solve this issue, I would be for ever grateful... :)

    Cheers,
    Che

  2. #2
    Registered User
    Join Date
    04-09-2010
    Location
    Amsterdam
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: XML import does not always show headers

    Bump!

    Nobody? :(

  3. #3
    Registered User
    Join Date
    06-20-2014
    Location
    Vancouver, BC
    MS-Off Ver
    2010
    Posts
    1

    Re: XML import does not always show headers

    Though I'm sure this has been solved already, this post comes up in google searches for info on this issue so I'm adding a solution here.

    Excel will parse your XML schema and add the nice blue headers with filters when there are repeating elements in the XML schema/file you wish to map/import.

    In my project, I was exporting non-repeating data to XML from a PDF form and then importing that information into Excel so that users could compile data from the form. I added two dummy fields to the form with the same name tag so that Excel would read the XML file as repeating. You then map your schema, and then unmap the dummy field. The headers will remain when you import new data.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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