更新时间:2023-11-25 15:20:16
您可以使用 ws.sheet_state
来查看工作表是 hidden
还是 visible代码>.
You can use ws.sheet_state
to find out whether the worksheet is hidden
or visible
.
from openpyxl import load_workbook
path = r"your_excel.xlsx"
wb = load_workbook(filename=path)
for i in wb.worksheets:
if i.sheet_state == "visible":
#do what you need to...