Skip to content Skip to sidebar Skip to footer

How Do I Convert A Csv File To Xlsb Using Python?

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.Count < 2 Then WScr

Solution 1:

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 )

Post a Comment for "How Do I Convert A Csv File To Xlsb Using Python?"