I am trying to convert an Excel file to an HTML file while keeping the format of the workbook.
Using Excel, I am able to switch from xlsx to htm: File -> Save as -> Web page (*.html, *.htm)
Using Python, I am always getting something gibberish like the below image as workbook.htm or workbook.html.
import xlwings as xw
file_path = "*.xlsx"
excel_app = xw.App(visible=False)
wb = excel_app.books.open(file_path)
wb.save("*.html")
wb.save("*.htm")
from xlsx2html import xlsx2html
xlsx2html('*xlsx', '*.htm')
xlsx2html('*xlsx', '*.html')
I have used dummy files, I am just trying to go from the xlsx file to the htm/hmtl file using Python and keeping the format, e.g. background colors, borders, etc.


