I am trying to create an new excel that contains the first sheet of a list of excel files.
I tried the following but of course line wb.create_sheet(sheet)
doesn't work.
wb = Workbook('new.xlsx')
for i in range(len(file_list)):
excel = load_workbook(file_list[i], read_only=False)
sheet = excel[excel.sheetnames[0]]
sheet.Name = tab_names_list[i]
wb.create_sheet(sheet)
wb.save('new.xlsx')
At the same time replacing wb.create_sheet(sheet)
with wb.copy_worksheet(sheet)
gives the error ValueError: Cannot copy worksheets in read-only or write-only mode