如何将 Excel HTML 文本文件保存到 Excel xls 二进制文件?

发布于 2024-12-02 08:01:31 字数 396 浏览 1 评论 0原文

这是经常被问到的问题之一,但问题和答案中省略了文本到二进制的机制。如果从 Excel 导出为 html,则它是 Excel html 文件。是否有一种工具可用于自动化目的,然后将此 html excel 文件转换回 Excel .xls 二进制 文件? (注:二进制是必需的。)此外,在 2003 年和 2007 年或更高版本中都可能吗?

我这样问的原因是因为有一个鲜为人知的秘密:您可以将 Excel html 文件另存为 .xls。这不是我想要的。我试图找到难以捉摸的“圣杯”答案,将 excel html(绑定到 excel html 模式)转换为二进制 .xls 文件。

商业目的是因为 Excel 二进制文件比 HTML 对应文件小得多且加载速度快得多,尤其是当文件大小达到 10 兆字节范围或更大时。

This is one of the questions that is asked alot, but the text to binary mechanism is left out in the question and the answer. If you export to html from excel it is an Excel html file. Is there a tool that can be used for automation purposes to then take this html excel file and convert it back into an Excel .xls binary file? (Note: Binary is a requirement.) Also is it possible in both 2003 and 2007 or greater?

The reason I ask it this way is because there is a little known secret: You can save an Excel html file as .xls. Which is not what I am looking for. I'm trying to find the elusive "Holy Grail" answer to convert an excel html (which is bound to an excel html schema) to binary .xls file.

The business pursose is becase an excel binary file will be much smaller and load much faster than its HTML counterpart especially when file sizes get into the 10Megabyte range and greater.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一腔孤↑勇 2024-12-09 08:01:31

在VBA中:

Sub Tester()

      Const FOLDER_PATH As String = "C:\path\to\files\"
      Dim wb As Workbook
      Set wb = Workbooks.Open(FOLDER_PATH & "NoName.html")
      wb.SaveAs Filename:=FOLDER_PATH & "NoName.xls", FileFormat:=xlExcel8

End Sub

In VBA:

Sub Tester()

      Const FOLDER_PATH As String = "C:\path\to\files\"
      Dim wb As Workbook
      Set wb = Workbooks.Open(FOLDER_PATH & "NoName.html")
      wb.SaveAs Filename:=FOLDER_PATH & "NoName.xls", FileFormat:=xlExcel8

End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文