Is there any way to reduce the size of .xls file which was generated through an automated shell or tcl so that I can send it over mail automatically. As of now I am manually converting .xls file into .xlsb which reduce its size from 25 mb to 5 mb and then sending report daily to required person. So is there any esay way to do this?
Asked
Active
Viewed 1,820 times
0
-
Look at https://stackoverflow.com/questions/6442698/convert-xls-to-xlsb-programatically it may help. – talex Jan 16 '18 at 06:05
-
And also google says http://www.softinterface.com/Convert-XLS/Features/Convert-XLSB.htm – talex Jan 16 '18 at 06:07
1 Answers
1
Python implementation
Convert xls file to csv:
import xlrd
w = xlrd.open_workbook(xls_filename, encoding_override="cp1251")
Convert generated csv to xlsb:
import win32com.client
excel=win32com.client.Dispatch("Excel.Application")
doc = excel.Workbooks.Open('csv_file')
doc.SaveAs( 'filename.xlsb', 50 )
Maybe you could directly convert from xls to xlsb instead of converting xls to an intermediate csv format.

Austin
- 25,759
- 4
- 25
- 48
-
Is there a way of converting xlsx to xlsb without converting to csv? This is because the formatting is getting lost when being converted to CSV format? – Roan Aug 27 '20 at 07:31