from win32com.client import DispatchEx
xl = DispatchEx('Excel.Application')
xl.Workbooks.Open('c:/excel_file.xls')
xl.ActiveWorkbook.ActiveSheet.Columns(1).AutoFilter(1)
xl.ActiveWorkbook.Close(SaveChanges=1)
xl.Quit()
del xl
How to create an excel file with an autofilter in the first row with xlwt?