Apply Autofilter to Excel Range using Python (xlwings)

This code is an example of applying an autofilter to an Excel spreadsheet using Python.
In particular, I am using xlwings. Keep in mind, xlwings in version 0.25.3 DOES NOT NATIVELY SUPPORT autofilter.
Therefore, I am using the underlying API as a workaround. Apart from looking ugly, keep in mind that it makes your code platform-specific (!).
This code works only on Windows.

Learn more about here:
https://docs.xlwings.org/en/stable/missing_features.html

Requirements

xlwings==0.25.3
openpyxl==3.0.9
pandas==1.3.5

Author

ko-fi

Feedback

If you have any feedback, please reach out to me at [email protected]

Logo

GitHub

View Github