Converting html to excel?

calendar_today Asked Mar 5, 2012
thumb_up 11 upvotes
history Updated April 16, 2026

Question posted 2012 · +11 upvotes

I know that excel is capable of opening html files directly. But the content of the file will still be html. Is there any way I can change the contents of the file from html to xls or xlsx?

Accepted answer +11 upvotes

So long as Excel can open the file, the functionality to change the format of the opened file is built in.

To convert an .html file, open it using Excel (File – Open) and then save it as a .xlsx file from Excel (File – Save as).

To do it using VBA, the code would look like this:

Sub Open_HTML_Save_XLSX()

    Workbooks.Open Filename:="C:TempExample.html"
    ActiveWorkbook.SaveAs Filename:= _
        "C:TempExample.xlsx", FileFormat:= _
        xlOpenXMLWorkbook

End Sub

Top excel Q&A (6)

+11 upvotes ranks this answer #67 out of 167 excel solutions on this site .