[英]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?
如何添加工作表而不覆盖工作簿中的所有其他工作表?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.