在excel 2007中打开生成的xls文件时发出警告

时间:2022-10-24 10:16:31

I get this warning when opening an XML file with the ending .xls but I want to use it as xls:

打开带有.xls结尾的XML文件时,我收到此警告,但我想将其用作xls:

http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/03/11/excel-2007-extension-warning.aspx

http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/03/11/excel-2007-extension-warning.aspx

How to solve this?

怎么解决这个?

i use .xls with this sourcecode:

我使用.xls与此源代码:

<?xml version="1.0" encoding="utf-8"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" 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">
<Worksheet ss:Name="Export">
<Table>

<Row> 
<Cell><Data ss:Type="Number">3</Data></Cell>

<Cell><Data ss:Type="Number">22123497</Data></Cell>

</Row>
</Table>
</Worksheet>
</Workbook>

1 个解决方案

#1


3  

Well as the commenters already mentionend your example-document is definitly not an xls-file (as those are binary) and Excel rightly complains to that fact (because a document might trick you with the wrong extension).

正如评论者已经提到你的示例文档肯定不是xls文件(因为它们是二进制文件)而Excel正确地抱怨这个事实(因为文档可能会用错误的扩展名欺骗你)。

What you should do is to save the document with file extension xml and add the processing-instruction for an office document (or in this case SpreadsheetML as oposed to the original binary/ propriatary excel-format)

你应该做的是保存文件扩展名为xml的文档,并为office文档添加处理指令(或者在这种情况下,SpreadsheetML选择为原始二进制/ propriatary excel格式)

<?xml version="1.0"?>
   <?mso-application progid="Excel.Sheet"?>
   <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
   ...

This used to work, but I just noticed that with Office 2007 the XML-processing component ("XML Editor") doesn't seem to be installed as default app for XML files. This did send XML-files to the correct application when they were opened (according to the processiong instuction). Maybe on your machine this works as it was intended to work (otherwise you might have to change this behaviour).

这曾经工作过,但我注意到,使用Office 2007时,XML处理组件(“XML编辑器”)似乎不会作为XML文件的默认应用程序安装。这确实在打开时将XML文件发送到正确的应用程序(根据processiong instuction)。也许在你的机器上这可以工作(否则你可能不得不改变这种行为)。

So this is basically the same the other commenters already said. Still I hope this helps.

所以这与其他评论者已经说过的基本相同。我仍然希望这会有所帮助。

Regards

问候

Andreas

安德烈亚斯

#1


3  

Well as the commenters already mentionend your example-document is definitly not an xls-file (as those are binary) and Excel rightly complains to that fact (because a document might trick you with the wrong extension).

正如评论者已经提到你的示例文档肯定不是xls文件(因为它们是二进制文件)而Excel正确地抱怨这个事实(因为文档可能会用错误的扩展名欺骗你)。

What you should do is to save the document with file extension xml and add the processing-instruction for an office document (or in this case SpreadsheetML as oposed to the original binary/ propriatary excel-format)

你应该做的是保存文件扩展名为xml的文档,并为office文档添加处理指令(或者在这种情况下,SpreadsheetML选择为原始二进制/ propriatary excel格式)

<?xml version="1.0"?>
   <?mso-application progid="Excel.Sheet"?>
   <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
   ...

This used to work, but I just noticed that with Office 2007 the XML-processing component ("XML Editor") doesn't seem to be installed as default app for XML files. This did send XML-files to the correct application when they were opened (according to the processiong instuction). Maybe on your machine this works as it was intended to work (otherwise you might have to change this behaviour).

这曾经工作过,但我注意到,使用Office 2007时,XML处理组件(“XML编辑器”)似乎不会作为XML文件的默认应用程序安装。这确实在打开时将XML文件发送到正确的应用程序(根据processiong instuction)。也许在你的机器上这可以工作(否则你可能不得不改变这种行为)。

So this is basically the same the other commenters already said. Still I hope this helps.

所以这与其他评论者已经说过的基本相同。我仍然希望这会有所帮助。

Regards

问候

Andreas

安德烈亚斯