Reputation: 1
I have an Excel file. I want to automatically open it and save it in HTML format. The below code is not working as internded. The converted HTML is not readable Kindly let me know how this can be done.
import win32com.client as win32
excel = win32.gencache.EnsureDispatch('Excel.Application')
excel.Visible = True
wb = excel.Workbooks.Open(r"Report.xlsx")
wb.Saveas("Report.html")
wb.Close()
excel.Quit()
Upvotes: 0
Views: 129
Reputation: 149
You could use pandas to open the Excel file and then pandas will export to HTML and other formats.
Upvotes: 1