beziehen
Code: Select all
if wb.sheets[sheetname].api.AutoFilterMode:
wb.sheets[sheetname].api.AutoFilter.ShowAllData()
< /code>
Aber wenn ich dies versuche Der Blattname usw. ist korrekt, da andere Code (nicht gezeigt) gut funktioniert. < /p>
import xlwings as xw
# Open the target workbook
wb = xw.Book('SOP_DL_AutofilterTest.xlsx')
ws = wb.sheets['SOP DL']
if wb.sheets['SOP DL'].api.AutoFilterMode:
wb.sheets['SOP DL'].api.AutoFilter.ShowAllData()
# Keep the window open
input("Press Enter to exit...") # This will keep the browser open until you press Enter