更新时间:2023-11-25 12:36:34
我刚刚处理了这个问题,尽管通常这不是一个好的编码选择,但是您可以使用内部的 Workbook _worksheets进行访问和设置工作簿对象的工作表.
I just dealt with this and although this is not generally a good coding choice, you can use the internal Workbook_worksheets to access and set the worksheets for a workbook object.
write_book._Workbook__worksheets = [write_book._Workbook__worksheets[0]]
这将去除除与工作簿相关的第一个工作表以外的所有内容
this would strip everything but the first worksheet associated with a Workbook