当需要对excel整列变更日期可用
import win32com.client
xlapp = win32com.client.Dispatch("Excel.Application")
# 操作可见
xlapp.Visible = True
xlapp.DisplayAlerts = False
wb = xlapp.Workbooks.Open(new_file)
# 获取Sheet页
sht = wb.Worksheets(1)
sht.Columns('B:C').NumberFormatLocal='yyyy-m-d'
wb.Save()
wb.Close()
xlapp.Quit()