I have some *.xls(excel 2003) files, and I want to convert those files into xlsx(excel 2007).
I use the uno python package, when I save the documents, I can set the
import sys, os
import win32com.client
directory = 'C:\\Users\\folder\\'
for file in os.listdir(directory):
dot = file.find('.')
end = file[dot:]
OutFile =file[0:dot] + ".xlsx"
App = win32com.client.Dispatch("Excel.Application")
App.Visible = True
workbook= App.Workbooks.Open(file)
workbook.ActiveSheet.SaveAs(OutFile, 51) #51 is for xlsx
workbook.Close(SaveChanges=True)
App.Quit()
Thank you.