I can set up an autofilter using pyWin32, but I wondered if it's possible to set a default filter and what the syntax would be.
For example, I'd like to set a filter on a year column and set the default for the current year.
xl = Dispatch("Excel.Application")
xl.Workbooks.Open(file_path)
xl.ActiveWorkbook.Worksheets(sheetname).Range("A2:A6").AutoFilter(1)
xl.ActiveWorkbook.Close(SaveChanges=1)
I've looked on the web for documentation on pywin32, and also Microsofts site, but can't work out how to translate the MS syntax to pywin32
Range("A2:A6").AutoFilter Field:=1, Criteria1:=rng.Value