xls格式转换为xlsx格式

import win32com.client as win32

fname = "C:\\myProjects\\daily\\data\\20171229\\标准化文档-20171226\\全量数据过滤表清单.xls"
excel = win32.gencache.EnsureDispatch('Excel.Application')
wb = excel.Workbooks.Open(fname)

wb.SaveAs(fname+"x", FileFormat = 51)    #FileFormat = 51 is for .xlsx extension
wb.Close()                               #FileFormat = 56 is for .xls extension
excel.Application.Quit()

  

posted on 2023-04-04 08:44  帅胡  阅读(165)  评论(0编辑  收藏  举报

导航