How do I convert a csv file to xlsb using Python?

前端 未结 1 517
长情又很酷
长情又很酷 2021-01-18 05:16

I want to convert a csv file to xlsb. I use the second answer from this Convert XLS to CSV on command line, which is the code below:

if WScript.Arguments.Cou         


        
相关标签:
1条回答
  • 2021-01-18 06:04

    According this, xlsb format - is xlExcel12 with value 50 (51 In Excel for the Mac). Also, you can use pywin32 library for converting:

    import win32com.client
    excel = win32com.client.Dispatch("Excel.Application")
    doc = excel.Workbooks.Open('D:\\input.csv')
    doc.SaveAs( 'D:\\output_bin.xlsb', 50 )
    
    0 讨论(0)
提交回复
热议问题