简体   繁体   English

Python xlsxwriter-将工作表添加到现有工作簿

[英]Python xlsxwriter - add a worksheet to an existing workbook

I am doing my first steps with xlswriter. 我正在与xlswriter合作。

I have an existing workbook test.xlsx , and I want to add to it a new worksheet - sheet 2 . 我有一个现有的工作簿test.xlsx ,我想在其中添加一个新的工作表-工作sheet 2

what I tried is the following: 我尝试的是以下内容:

import xlsxwriter as xl
xbook=xl.Workbook('test.xlsx')
xbook.add_worksheet('sheet2')

The problem with this is that it overrides all the other sheets in the workbook. 问题在于它会覆盖工作簿中的所有其他工作表。 How can I add a worksheet without overriding all the other worksheets in the workbook? 如何添加工作表而不覆盖工作簿中的所有其他工作表?

I don't think this is still possible with xlsxwriter. 我认为xlsxwriter仍然无法做到这一点。 Please take a look at this answer for help 请查看此答案以获取帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM