开发者

How do you save an Excel HTML text file to an Excel xls binary file?

开发者 https://www.devze.com 2023-03-31 16:49 出处:网络
This is one of the questions that is asked alot, but the text to binar开发者_JS百科y mechanism is left out in the question and the answer.If you export to html from excel it is an Excel html file. Is

This is one of the questions that is asked alot, but the text to binar开发者_JS百科y 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.


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号