def dump_xlsx(): wb = Workbook() wb._active_sheet_index = 0 # xetting the sheet ws = wb.active ws.title = "New Title" ws = wb.create_sheet("EDP sheet", 0) ws['A4'] = 4 ws.cell(row=4, column=2, value=10) wb.save('example.xlsx')
from openpyxl import Workbook wb = Workbook() ws2 = wb.create_sheet() ws3 = wb.create_sheet() print(wb.sheetnames) print(wb._active_sheet_index) wb._active_sheet_index = 1 print(wb._active_sheet_index)