Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我有什么excel格式的文件?_Excel - Fatal编程技术网

我有什么excel格式的文件?

我有什么excel格式的文件?,excel,Excel,我得到了一个.XLS格式的excel文件,Excel2007可以打开它,但会抛出一条消息说文件是另一种格式的,然后是一个扩展名,如果我确定要打开它 我在记事本中打开文件,这些是第一行 <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"&

我得到了一个.XLS格式的excel文件,Excel2007可以打开它,但会抛出一条消息说文件是另一种格式的,然后是一个扩展名,如果我确定要打开它

我在记事本中打开文件,这些是第一行

<html xmlns:o="urn:schemas-microsoft-com:office:office"      xmlns:x="urn:schemas-microsoft-com:office:excel"      xmlns="http://www.w3.org/TR/REC-html40">
<meta name="ProgId" content="Excel.Sheet" />
<meta name="Generator" content="Microsoft Excel 9" />
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>

我尝试将文件保存为其他格式,如.xml、.ods等,但找不到真正的格式/扩展名。你不知道是什么吗?它似乎与excel完全兼容。

好的,我找到了格式,它的.XLHTML

这个C代码告诉我

Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();

excelApp.Visible = false;

Microsoft.Office.Interop.Excel.Workbook eWorkbook = excelApp.Workbooks.Open(xlsFilePath, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);

Console.WriteLine(eWorkbook.FileFormat.ToString());

Console.ReadLine();

这看起来像一个Excel文件被保存为网页。尝试将其重命名为*.html并在浏览器中打开。它可以在浏览器中打开,但格式不正确/已损坏。我尝试创建.xls文件并将其另存为.html,文件头非常相似,但差别不大