We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
您好,做了很多research都没有解决这个问题,所来这里求助一下,我从a文件中读取了worksheet对象
sheet_2_workbook = openpyxl.load_workbook(sheet_2_path) sheet_2 = sheet_2_workbook.worksheets[0]
如题,我想将其添加到现有xlsx文档的新sheet/工作簿中,具体应该怎么操作呢?
我之前有尝试这么做,但是这个方法得到的新文档会丢失原有的一些格式,包括单元格底色和合并单元格
old_wb = openpyxl.load_workbook(file_list[i]) old_sheet_name = old_wb.get_sheet_names()[0] old_ws = old_wb[old_sheet_name] ws2 = combined_wb.create_sheet(sheet_name) for row in old_ws.values: ws2.append(row)
我很肯定a文件中读取的worksheet对象是包含这些格式的,因为我用下面代码转存的xlsx文档具备上述提到的格式 sheet_2_workbook.save(filename = temp_save_path)
sheet_2_workbook.save(filename = temp_save_path)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
您好,做了很多research都没有解决这个问题,所来这里求助一下,我从a文件中读取了worksheet对象
如题,我想将其添加到现有xlsx文档的新sheet/工作簿中,具体应该怎么操作呢?
我之前有尝试这么做,但是这个方法得到的新文档会丢失原有的一些格式,包括单元格底色和合并单元格
我很肯定a文件中读取的worksheet对象是包含这些格式的,因为我用下面代码转存的xlsx文档具备上述提到的格式
sheet_2_workbook.save(filename = temp_save_path)
The text was updated successfully, but these errors were encountered: