Copy whole worksheet with openpyxl

时光总嘲笑我的痴心妄想 提交于 2019-11-27 08:57:26
psychok7

Version 2.4 will allow you to do this: copy_worksheet

>>> source = wb.active
>>> target = wb.copy_worksheet(source)

For older ones you can probably copy the source code from here

UPDATE: You can't simply graft this code into older versions of the library

You can't do this easily. The best approach is probably the one described in bug 171

I had the same problem. I solved using copy instead deepcopy. I found the solution on this site

I hope this works for you!

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!