这个xls有什么问题?

What's wrong with this xls?

当我用 Microsoft Excel 打开此 xls 时,出现下一条消息:"The file format and extension of "proof.xls" 不匹配。文件可能已损坏或不安全。除非您信任其来源, 不要打开它。您仍然要打开它吗?"。

Microsoft Office 无论如何都会打开文档并让我将其另存为新格式,但我需要此文档可读 "on the fly"(无需使用 Excel 打开和保存文件步骤)才能加载它与 PHPExcel.

此文件来自自动网页生成器,我不知道它对 xls 的编码究竟如何。

这里是文件结构摘录(table只有第一行,不能粘贴整个文件内容):

   <?xml version="1.0" encoding="ISO-8859-1"?>
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:user="urn:my-scripts" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:o="urn:schemas-microsoft-com:office:office"><ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"><WindowHeight>9345</WindowHeight><WindowWidth>15180</WindowWidth><WindowTopX>120</WindowTopX><WindowTopY>60</WindowTopY><ProtectStructure>False</ProtectStructure><ProtectWindows>False</ProtectWindows></ExcelWorkbook><ss:Styles><ss:Style ss:Name="titulo" ss:ID="titulo"><NumberFormat ss:Format="@"/><Alignment ss:WrapText="0" ss:VerticalText="0" ss:Vertical="Center" ss:ShrinkToFit="0" ss:Rotate="0.0" ss:ReadingOrder="LeftToRight" ss:Indent="0" ss:Horizontal="Center"/><ss:Interior ss:Color="Automatic" ss:PatternColor="Automatic" ss:Pattern="None"/><ss:Protection x:HideFormula="
0" ss:Protected="0"/><ss:Font x:Family="Automatic" ss:VerticalAlign="None" ss:Underline="None" ss:StrikeThrough="0" ss:Size="14.0" ss:Shadow="0" ss:Outline="0" ss:Italic="0" ss:FontName="Arial" ss:Color="Automatic" ss:Bold="1"/></ss:Style><ss:Style ss:Name="subtitulo-negrita" ss:ID="subtitulo-negrita"><NumberFormat ss:Format="@"/><Alignment ss:WrapText="0" ss:VerticalText="0" ss:Vertical="Center" ss:ShrinkToFit="0" ss:Rotate="0.0" ss:ReadingOrder="LeftToRight" ss:Indent="0" ss:Horizontal="Left"/><ss:Interior ss:Color="Automatic" ss:PatternColor="Automatic" ss:Pattern="None"/><ss:Protection x:HideFormula="0" ss:Protected="0"/><ss:Font x:Family="Automatic" ss:VerticalAlign="None" ss:Underline="None" ss:StrikeThrough="0" ss:Size="12.0" ss:Shadow="0" ss:Outline="0" ss:Italic="0" ss:FontName="Arial" ss:Color="Automatic" ss:Bold="1"/></ss:Style><ss:Style ss:Name="subtitulo" ss:ID="subtitulo"><NumberFormat ss:Format="@"/><Alignment ss:WrapText="0" ss:VerticalText="0" ss:Vertical="Center" ss:ShrinkToFit="0" ss:
Rotate="0.0" ss:ReadingOrder="LeftToRight" ss:Indent="0" ss:Horizontal="Left"/><ss:Interior ss:Color="Automatic" ss:PatternColor="Automatic" ss:Pattern="None"/><ss:Protection x:HideFormula="0" ss:Protected="0"/><ss:Font x:Family="Automatic" ss:VerticalAlign="None" ss:Underline="None" ss:StrikeThrough="0" ss:Size="12.0" ss:Shadow="0" ss:Outline="0" ss:Italic="0" ss:FontName="Arial" ss:Color="Automatic" ss:Bold="0"/></ss:Style><ss:Style ss:Name="cabecera-tabla" ss:ID="cabecera-tabla"><NumberFormat ss:Format="@"/><Alignment ss:WrapText="0" ss:VerticalText="0" ss:Vertical="Center" ss:ShrinkToFit="0" ss:Rotate="0.0" ss:ReadingOrder="LeftToRight" ss:Indent="0" ss:Horizontal="Center"/><ss:Interior ss:Color="Automatic" ss:PatternColor="Automatic" ss:Pattern="None"/><ss:Protection x:HideFormula="0" ss:Protected="0"/><ss:Font x:Family="Automatic" ss:VerticalAlign="None" ss:Underline="None" ss:StrikeThrough="0" ss:Size="11.0" ss:Shadow="0" ss:Outline="0" ss:Italic="0" ss:FontName="Arial" ss:Color="Automatic" ss:Bold="1"
/></ss:Style><ss:Style ss:Name="contenido-tabla" ss:ID="contenido-tabla"><NumberFormat ss:Format="@"/><Alignment ss:WrapText="0" ss:VerticalText="0" ss:Vertical="Center" ss:ShrinkToFit="0" ss:Rotate="0.0" ss:ReadingOrder="LeftToRight" ss:Indent="0" ss:Horizontal="Center"/><ss:Interior ss:Color="Automatic" ss:PatternColor="Automatic" ss:Pattern="None"/><ss:Protection x:HideFormula="0" ss:Protected="0"/><ss:Font x:Family="Automatic" ss:VerticalAlign="None" ss:Underline="None" ss:StrikeThrough="0" ss:Size="10.0" ss:Shadow="0" ss:Outline="0" ss:Italic="0" ss:FontName="Arial" ss:Color="Automatic" ss:Bold="0"/></ss:Style></ss:Styles><Worksheet ss:Name="ACTIVITAT OCUPACIÓ"><ss:Table ss:DefaultColumnWidth="120" x:FullRows="1" x:FullColumns="1" ss:ExpandedRowCount="64000" ss:ExpandedColumnCount="500"><Row><Cell ss:MergeDown="0" ss:MergeAcross="4" ss:StyleID="titulo"><Data ss:Type="String">LLISTAT ACTIVITAT OCUPACIÓ</Data></Cell></Row><Row><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="subtitulo-negrita"><Data 
ss:Type="String">Data inicial</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="subtitulo"><Data ss:Type="String">01/09/2015</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="subtitulo"><Data ss:Type="String"/></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="subtitulo-negrita"><Data ss:Type="String">Data final</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="subtitulo"><Data ss:Type="String">31/01/2016</Data></Cell></Row><Row><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="subtitulo-negrita"><Data ss:Type="String">Centre gestor</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="3" ss:StyleID="subtitulo"><Data ss:Type="String">105 - Facultat de Ciències de la Comunicació</Data></Cell></Row><Row><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="subtitulo-negrita"><Data ss:Type="String">Edifici/s</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="3" ss:StyleID="subtitulo"><Data ss:Type="String">Fac. Ciènc.  de la Comunicació</Data></
Cell></Row><Row><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="cabecera-tabla"><Data ss:Type="String">Data inicial</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="cabecera-tabla"><Data ss:Type="String">Hora inicial</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="cabecera-tabla"><Data ss:Type="String">Data final</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="cabecera-tabla"><Data ss:Type="String">Hora final</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="cabecera-tabla"><Data ss:Type="String">Total hores</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="cabecera-tabla"><Data ss:Type="String">Espai</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="cabecera-tabla"><Data ss:Type="String">Estudi</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="cabecera-tabla"><Data ss:Type="String">Activitat</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="cabecera-tabla"><Data 
ss:Type="String">Professor/Responsable</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="cabecera-tabla"><Data ss:Type="String">Alumnes matriculats</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="cabecera-tabla"><Data ss:Type="String">Observacions</Data></Cell></Row><Row><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="String">01/09/2015</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="String">08:30</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="String">01/09/2015</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="String">21:00</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="Number">12.5</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="String">I/105EM/462</Data></Cell><Cell ss:MergeDown="0" 
ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="String"/></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="String">02/09/2015</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="String">21:00</Data></Cell><Cell 
ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="Number">12.5</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="String">I/105EM/462</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="String"/></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="String">Màster DCEI</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="String">Chacon Garcia, Laura</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="Number">0</Data></Cell><Cell ss:MergeDown="0" ss:MergeAcross="0" ss:StyleID="contenido-tabla"><Data ss:Type="String"> </Data></Cell></Row>
</ss:Table><WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"><PageSetup><Header x:Margin="0"/><Footer x:Margin="0"/><PageMargins x:Top="0.984251969" x:Right="0.78740157499999996" x:Left="0.78740157499999996" x:Bottom="0.984251969"/></PageSetup><Selected/><FreezePanes/><FrozenNoSplit/><SplitHorizontal>5</SplitHorizontal><TopRowBottomPane>5</TopRowBottomPane><ActivePane>2</ActivePane><Panes><Pane><Number>3</Number></Pane><Pane><Number>2</Number><ActiveRow>4</ActiveRow><ActiveCol>2</ActiveCol></Pane></Panes><ProtectObjects>False</ProtectObjects><ProtectScenarios>False</ProtectScenarios></WorksheetOptions></Worksheet></Workbook>

那是因为它不是 .xls 文件

.xls 文件是一种名为 BIFF 的二进制格式,在 OLE2 包装器中。

您部分发布的文件是 SpreadSheetML 格式文件,一种 Excel 2003 年引入的 XML 格式,但从未证明特别流行,并且后来被 OfficeOpenXML (.xlsx) 格式取代。

这是一种有效的电子表格格式,MS Excel 完全可以阅读,但它不是 BIFF 格式,因此有人抱怨扩展名与格式不匹配。

将扩展名更改为.xml,然后在MS中阅读Excel。