How to convert SpreadsheetMl created in 2007 to 2010

1k views Asked by At

I have a xml spreadsheetml document. This is used to create an excel document through my silverlight application. When the file created through this template is saved as *.xlsx Excel 2010 throws an error

"Excel cannot open file '*.xlsx' because the file format or extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."

However, if the file is saved as .xls or .xml then there is no problem and it can be opened through Excel 2010.

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40">
  <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
    <Author></Author>
    <LastAuthor></LastAuthor>
    <Created>2010-10-25T14:17:17Z</Created>
    <LastSaved>2010-10-25T14:17:17Z</LastSaved>
    <Company></Company>
    <Version></Version>
  </DocumentProperties>
  <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
    <WindowHeight>12015</WindowHeight>
    <WindowWidth>20055</WindowWidth>
    <WindowTopX>480</WindowTopX>
    <WindowTopY>150</WindowTopY>
    <ProtectStructure>False</ProtectStructure>
    <ProtectWindows>False</ProtectWindows>
  </ExcelWorkbook>
  <Styles>
    <Style ss:ID="Default" ss:Name="Normal">
      <Alignment ss:Horizontal="Left" ss:Vertical="Center"/>
      <Borders/>
      <Font ss:Color="#000000"/>
      <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
      <NumberFormat/>
      <Protection/>
    </Style>
    <Style ss:ID="s21">
      <NumberFormat ss:Format="Short Date"/>
    </Style>
    <Style ss:ID="s22">
      <NumberFormat ss:Format="0"/>
    </Style>
  </Styles>
  <Worksheet ss:Name="Sheet1">
    <Table>
***
    </Table>
  </Worksheet>
</Workbook>

How can this template be upgraded to match the Excel 2010 format?

1

There are 1 answers

2
jmcnamara On

This warning is a result of Extension Hardening in Excel 2007+.

How can this template be upgraded to match the Excel 2010 format?

It can't be upgraded without using some external application that understands both formats. The SpreadsheetXML and XLSX formats are very different.