0

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()

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.