创建Excel文件作为html标记

时间:2022-11-19 22:58:25

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

我有一些纯文本文件。扩展名xls)带有下一个标记(附件)。它在excel 2003中打开,没有任何错误。

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

现在我需要知道什么是技术,什么时候我可以通过html标记创建excel文件?

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

因为我需要在Excel 2007和更早的时候修复这个文件。(我现在看到“不同格式的文件”错误)。

<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">
<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 个解决方案

#1


4  

The message is new to Excel 2007.

这是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

在HKEY_CURRENT_USER\Software\Microsoft\Office 12.0\Excel Security中,添加一个名为extension_user的新DWORD值,并将其值设置为0

Alternately a group policy can be set.

还可以设置组策略。

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

有关详细信息,请参阅这篇知识库文章:“当您在excel2007中打开文件时……”


  • Excel 2000 added support for Hypertext Markup Language (HTML) as a native file format - HTML, CSS & XML
  • Excel 2000增加了对超文本标记语言(HTML)作为本地文件格式的支持——HTML、CSS和XML
  • Excel 2003 added support for Microsoft Office XML formats - SpreadsheetML
  • Excel 2003增加了对Microsoft Office XML格式的支持。
  • Excel 2007 added support for Office Open XML
  • Excel 2007增加了对Office Open XML的支持。

Your example code is based on the Excel 2000 format.

示例代码基于Excel 2000格式。

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

这项技术似乎没有具体的名称。

It is sometimes referred to as Office XML/HTML.

它有时被称为Office XML/HTML。

#1


4  

The message is new to Excel 2007.

这是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

在HKEY_CURRENT_USER\Software\Microsoft\Office 12.0\Excel Security中,添加一个名为extension_user的新DWORD值,并将其值设置为0

Alternately a group policy can be set.

还可以设置组策略。

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

有关详细信息,请参阅这篇知识库文章:“当您在excel2007中打开文件时……”


  • Excel 2000 added support for Hypertext Markup Language (HTML) as a native file format - HTML, CSS & XML
  • Excel 2000增加了对超文本标记语言(HTML)作为本地文件格式的支持——HTML、CSS和XML
  • Excel 2003 added support for Microsoft Office XML formats - SpreadsheetML
  • Excel 2003增加了对Microsoft Office XML格式的支持。
  • Excel 2007 added support for Office Open XML
  • Excel 2007增加了对Office Open XML的支持。

Your example code is based on the Excel 2000 format.

示例代码基于Excel 2000格式。

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

这项技术似乎没有具体的名称。

It is sometimes referred to as Office XML/HTML.

它有时被称为Office XML/HTML。