Abhijith
Abhijith

Reputation: 1

Using Python convert excel sheet to different format

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

Answers (1)

Dini
Dini

Reputation: 149

You could use pandas to open the Excel file and then pandas will export to HTML and other formats.

Upvotes: 1

Related Questions