from aspose.cells import Workbook # For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET # Load the sample Excel file wb = Workbook(sourceDir + "sampleGetAllHiddenRowsIndicesAfterRefreshingAutoFilter.xlsx") # Access first worksheet ws = wb.worksheets[0] # Apply autofilter ws.auto_filter.add_filter(0, "Orange") # True means, it will refresh autofilter and return hidden rows. # False means, it will not refresh autofilter but return same hidden rows. rowIndices = ws.auto_filter.refresh(True) print("Printing Rows Indices, Cell Names and Values Hidden By AutoFilter.") print("--------------------------") for i in range(len(rowIndices)): r = rowIndices[i] cell = ws.cells.get(r, 0) print(str(str(str(str(r) + "\t" ) + cell.name) + "\t" ) + cell.string_value)