Warning when opening generated xls file in excel 2007

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

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

How to solve this?

I am using .xls with this source code:

 <?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> 
+6
source share
1 answer

Well, as commentators have already pointed out, your sample document is definitely not an xls file (since it is binary), and Excel rightly complains about this fact (since the document may trick you with the wrong extension).

What you have to do is save the xml document and add the processing instruction for the office document (or in this case SpreadsheetML, the original binary / proprietary excel format)

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

This worked, but I just noticed that with Office 2007, the XML processing component ("XML Editor") does not seem to be installed as the default application for XML files. This sent the XML files to the correct application when they were opened (according to the processiong instruction). It may work on your machine the way it was planned to work (otherwise you may have to change this behavior).

So this is basically the same as other commentators have already said. Nevertheless, I hope this helps.

Hi

Andreas

+3
source

Source: https://habr.com/ru/post/897312/


All Articles