from aspose.cells import FilterOperatorType, Workbook # For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET # The path to the documents directory. # Source directory sourceDir = RunExamples.Get_SourceDirectory() # Output directory outputDir = RunExamples.Get_OutputDirectory() # Instantiating a Workbook object # Opening the Excel file through the file stream workbook = Workbook(sourceDir + "Number.xlsx") # Accessing the first worksheet in the Excel file worksheet = workbook.worksheets[0] # Call Custom function to apply the filter worksheet.auto_filter.custom(0, FilterOperatorType.GREATER_OR_EQUAL, 5, True, FilterOperatorType.LESS_OR_EQUAL, 10) # Call refresh function to update the worksheet worksheet.auto_filter.refresh() # Saving the modified Excel file workbook.save(outputDir + "FilteredNumber.xlsx")