none
xml2xls RRS feed

  • Question

  • Why won't this open in Excel?

     

    <?xml version="1.0"?>
    <!-- http://msdn.microsoft.com/en-us/library/aa140066(v=office.10).aspx -->
    <ss:Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:spreadsheet">
        <ss:Styles>
            <ss:Style ss:ID="alpha-bold">
                <ss:Alignment ss:Horizontal="Left" ss:Vertical="Top"/>
                <ss:Borders>
                    <ss:Border/>
                </ss:Borders>
                <ss:Font ss:Bold="1"/>
                <ss:Interior/>
                <ss:NumberFormat/>
                <ss:Protection/>
            </ss:Style>
            <ss:Style ss:ID="number-bold">
                <ss:Alignment ss:Horizontal="Right" ss:Vertical="Top"/>
                <ss:Borders>
                    <ss:Border/>
                </ss:Borders>
                <ss:Font ss:Bold="1"/>
                <ss:Interior/>
                <ss:NumberFormat/>
                <ss:Protection/>
            </ss:Style>
            <ss:Style ss:ID="alpha">
                <ss:Alignment ss:Horizontal="Left" ss:Vertical="Top"/>
                <ss:Borders>
                    <ss:Border/>
                </ss:Borders>
                <ss:Font/>
                <ss:Interior/>
                <ss:NumberFormat/>
                <ss:Protection/>
            </ss:Style>
            <ss:Style ss:ID="number">
                <ss:Alignment ss:Horizontal="Right" ss:Vertical="Top"/>
                <ss:Borders>
                    <ss:Border/>
                </ss:Borders>
                <ss:Font/>
                <ss:Interior/>
                <ss:NumberFormat ss:Type="Number"/>
                <ss:Protection/>
            </ss:Style>
            <ss:Style ss:ID="red">
                <ss:Alignment ss:Horizontal="Right" ss:Vertical="Top"/>
                <ss:Borders>
                    <ss:Border/>
                </ss:Borders>
                <ss:Font ss:Color="#FF0000"/>
                <ss:Interior/>
                <ss:NumberFormat ss:Type="Number"/>
                <ss:Protection/>
            </ss:Style>
        </ss:Styles>
        <ss:Worksheet ss:Name="Hello World">
            <ss:Table>
                <ss:Column ss:Width="240" ss:StyleID="alpha"/>
                <ss:Column ss:Width="80" ss:StyleID="number"/>
                <ss:Column ss:Width="128" ss:StyleID="alpha"/>
                <ss:Row>
                    <ss:Cell ss:StyleID="alpha-bold">
                        <ss:Data>First Name</ss:Data>
                    </ss:Cell>
                    <ss:Cell ss:StyleID="number-bold">
                        <ss:Data>Number</ss:Data>
                    </ss:Cell>
                    <ss:Cell ss:StyleID="alpha-bold">
                        <ss:Data>Date</ss:Data>
                    </ss:Cell>
                </ss:Row>
                <ss:Row>
                    <ss:Cell>
                        <ss:Data>Brian</ss:Data>
                    </ss:Cell>
                    <ss:Cell ss:StyleID="red">
                        <ss:Data>-12345.67</ss:Data>
                    </ss:Cell>
                    <ss:Cell>
                        <ss:Data>12-14-2011</ss:Data>
                    </ss:Cell>
                </ss:Row>
                <ss:Row>
                    <ss:Cell>
                        <ss:Data>Chad</ss:Data>
                    </ss:Cell>
                    <ss:Cell>
                        <ss:Data>666.00</ss:Data>
                    </ss:Cell>
                    <ss:Cell>
                        <ss:Data>01-31-2011</ss:Data>
                    </ss:Cell>
                </ss:Row>
                <ss:Row>
                    <ss:Cell>
                        <ss:Data>Shawn</ss:Data>
                    </ss:Cell>
                    <ss:Cell ss:StyleID="red">
                        <ss:Data>-17.33</ss:Data>
                    </ss:Cell>
                    <ss:Cell>
                        <ss:Data>04-01-2012</ss:Data>
                    </ss:Cell>
                </ss:Row>
                <ss:Row>
                    <ss:Cell>
                        <ss:Data>Scott</ss:Data>
                    </ss:Cell>
                    <ss:Cell>
                        <ss:Data>321.654</ss:Data>
                    </ss:Cell>
                    <ss:Cell>
                        <ss:Data>06-09-2006</ss:Data>
                    </ss:Cell>
                </ss:Row>
                <ss:Row>
                    <ss:Cell>
                        <ss:Data>Kevin</ss:Data>
                    </ss:Cell>
                    <ss:Cell>
                        <ss:Data>4000.0000</ss:Data>
                    </ss:Cell>
                    <ss:Cell>
                        <ss:Data>10-27-2007</ss:Data>
                    </ss:Cell>
                </ss:Row>
            </ss:Table>
            <c:WorksheetOptions>
                <c:DisplayCustomHeaders/>
            </c:WorksheetOptions>
            <x:WorksheetOptions>
                <x:PageSetup>
                    <x:Layout/>
                    <x:PageMargins/>
                    <x:Header/>
                    <x:Footer/>
                </x:PageSetup>
            </x:WorksheetOptions>
            <x:AutoFilter>
                <x:AutoFilterColumn>
                    <x:AutoFilterCondition/>
                    <x:AutoFilterAnd>
                        <x:AutoFilterCondition/>
                    </x:AutoFilterAnd>
                    <x:AutoFilterOr>
                        <x:AutoFilterCondition/>
                    </x:AutoFilterOr>
                </x:AutoFilterColumn>
            </x:AutoFilter>
        </ss:Worksheet>
    </ss:Workbook>

     

     

    Friday, June 3, 2011 9:53 PM

Answers

  • Hi Peter,
     
    It is obscure - and, IMO, fundamentally wrong - to use Temporary Internet Files as a location for this, but I don't believe it is changeable. It hadn't occurred to me that Windows might be overriding the location and my suspicion would be that if it did that it wouldn't tell Excel, and it would do it with some kind of redirect behind the scenes. I do have to applaud Excel for both writing a log and telling the user where it has put it - more often than not one is left guessing.
     
    The nature of the various folders in Temporary Internet Files is irritating, but when in it in Windows Explorer, you can edit the address bar and add "Content.MSO" to see that folder. I don't know any single step process to get to Temporary Internet Files - depending on what else I am doing and/or how I feel, I might navigate to it or I might jump via Internet options in IE or the Control Panel (inetcpl.cpl).
     

    Enjoy,
    Tony
    www.WordArticles.com
    • Proposed as answer by Bruce Song Tuesday, June 21, 2011 2:00 PM
    • Marked as answer by Bruce Song Tuesday, June 28, 2011 12:22 PM
    Sunday, June 5, 2011 8:45 AM

All replies

  • It won't open because the XML does not conform to what Excel expects.

    One example (looking at the reference that you point to... http://msdn.microsoft.com/en-us/library/aa140066(v=office.10).aspx )

    is that <ss:Data> requires an ss:Type attribute, e.g. you need

                        <ss:Data ss:Type="String">Brian</ss:Data>

    and you need "Number" and "DateTime" as the types for your other strings. I assume that there could be plenty of other required attributes and perhaps elements.

    I haven't checked that that is what the XML schema for Excel 2003/XP actually demands, but imagine it is:

    http://www.microsoft.com/downloads/en/details.aspx?familyid=fe118952-3547-420a-a412-00a2662442d9&displaylang=en

     


    Peter Jamieson
    Saturday, June 4, 2011 1:05 PM
  • Why don't you look at the error log, which tells you everything that is wrong with it - albeit a little cryptically?
     
    As well as what Peter has said, you can't have a Border tag without Attributes (ss:Border />).
     

    Enjoy,
    Tony
    www.WordArticles.com
    Saturday, June 4, 2011 5:55 PM
  • Hi Tony,

    If you have any hints on how to locate the error log, or modify the location where Excel puts it, they woud be welcome.

    e.g. here, now, Excel puts it in a file with a name like this:

    C:\Users\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.MSO\8E173FCD.log

    and in this particular case, "Temporary Internet Files" was a hidden System file, and when revealed, did not contain a Content.MSO. An attempt to open the file directly (e.g. in IE) failed.  In other cases, it is difficult to reach the specified folder because of security constraints.
    Combined with the fact that you can't just open the log from a button in the dialog, and the fact that, as usual, you just can't copy the path/file name from the dialog box, this is one of the more frustrating "error in failure routines" I've come across.
    I have a suspicion that this is either to do with working in a Domain (where stuff actually tends to be put in Roaming folders) or some other modern Windows artefact whereby Excel thinks it's putting the log file in place A but Windows actually thinks that's a bit dodgy and puts it somewhere else.
    I expect I could chase this one down, but it's likely quicker if someone just Knows the Answer :-)
    Peter


    Peter Jamieson
    Sunday, June 5, 2011 6:14 AM
  • Hi Peter,
     
    It is obscure - and, IMO, fundamentally wrong - to use Temporary Internet Files as a location for this, but I don't believe it is changeable. It hadn't occurred to me that Windows might be overriding the location and my suspicion would be that if it did that it wouldn't tell Excel, and it would do it with some kind of redirect behind the scenes. I do have to applaud Excel for both writing a log and telling the user where it has put it - more often than not one is left guessing.
     
    The nature of the various folders in Temporary Internet Files is irritating, but when in it in Windows Explorer, you can edit the address bar and add "Content.MSO" to see that folder. I don't know any single step process to get to Temporary Internet Files - depending on what else I am doing and/or how I feel, I might navigate to it or I might jump via Internet options in IE or the Control Panel (inetcpl.cpl).
     

    Enjoy,
    Tony
    www.WordArticles.com
    • Proposed as answer by Bruce Song Tuesday, June 21, 2011 2:00 PM
    • Marked as answer by Bruce Song Tuesday, June 28, 2011 12:22 PM
    Sunday, June 5, 2011 8:45 AM
  • you can edit the address bar and add "Content.MSO" to see that folder

    That did the trick.

    Thanks, Tony - you saved me a lot of time. The file was there, not relocated as I feared.


    Peter Jamieson
    Sunday, June 5, 2011 8:52 AM