tags:

views:

41

answers:

1

Hi.

I have some plain text file (.xls extension) with next markup (attached below). It's opening in excel 2003 without any error.

Now I need to know what is the name of technology, when I could create excel file through html markup?

Becouse I need to fix this file to open correctly in Excel 2007 and earlier. (I see "file in the different format" error now).

<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"&gt;
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel">
<!--[if gte mso 9]><xml>
 <x:ExcelWorkbook>
  <x:ExcelWorksheets>
   <x:ExcelWorksheet>
    <x:Name>Sheet1</x:Name>
    <x:WorksheetOptions>
     <x:Selected/>
     <x:ProtectContents>False</x:ProtectContents>
     <x:ProtectObjects>False</x:ProtectObjects>
     <x:ProtectScenarios>False</x:ProtectScenarios>
    </x:WorksheetOptions>
   </x:ExcelWorksheet>
  </x:ExcelWorksheets>
  <x:ProtectStructure>False</x:ProtectStructure>
  <x:ProtectWindows>False</x:ProtectWindows>
</x:ExcelWorkbook>
</xml><![endif]-->
<style>
<!--table
    {mso-displayed-decimal-separator:"\.";
    mso-displayed-thousand-separator:" ";}
.xl2
    {
    mso-number-format:M/D/YY;
    border-left:.5pt solid;
    border-top:.5pt solid;
    border-right:.5pt solid;
    border-bottom:.5pt solid;
    }
.xl3
    {
    border-left:.5pt solid;
    border-top:.5pt solid;
    border-right:.5pt solid;
    border-bottom:.5pt solid;
    }
-->
</style>
</head>
<body>
<table>
<tr>
<td class=xl2>17.02.2010</td>
<td class=xl3>4</td>
<td class=xl3>0</td>
</tr>
<tr>
</tr>
</table>
</body>
</html>
+1  A: 

The message is new to Excel 2007.

The warning message was added to help prevent issues due to differences between the actual contents of the file and the file extension.

A registry key can be edited to stop the message from displaying.

Under HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security Add a new DWORD Value called ExtensionHardening and set it's value to 0

Alternately a group policy can be set.

See this knowledge base article for more details: "When you open a file in Excel 2007..."


  • Excel 2000 added support for Hypertext Markup Language (HTML) as a native file format - HTML, CSS & XML
  • Excel 2003 added support for Microsoft Office XML formats - SpreadsheetML
  • Excel 2007 added support for Office Open XML

Your example code is based on the Excel 2000 format.

There doesn't seem to be a specific name for the technology.

It is sometimes referred to as Office XML/HTML.

Robert Mearns
May be some additional urn headers in the file I should insert instead of registry tweak? Our security level may not be able to allow this tweak.
Akim Khalilov
An alternate is to save the file with a .html extension. This can be opened from Excel without the warning being displayed via the Office button and Open command. The downside is that if the file is opened by double clicking on it, it will open in the default web browser instead of Excel.
Robert Mearns