File is getting corrupt when copying the sheet multiple times in the same workbook
Created originally on Bitbucket by Pratik gupta
Hello Sir,
I’ve been writing a python script for automating my invoice generation work. In my script, first it loads a existing file and copies the sheet with reference to the last index of workbook then it changes some information and then saves the file.
While testing my code, the script worked for 15-20 times but then after it has given an error and my source file was corrupted. Again I’ve tried my script for new excel file but it keeps on corrupting my file.
Excel: version 2016 1908 build 11929.20254
Python: version 3.7.3
Openpyxl: version 2.6.3
I hope that you’ll figure out the problem. I’m attesting you my script, screenshot of error, error log, corrupt excel file and a fresh excel file for testing purpose(if you need to test my script). Also I’ve few questions regarding to openpyxl,
- Does it have a printing file option?(only the current or active page)
- Can I copy the sheet from one workbook to another?
I’m a newbie and this is my first issue report, so if you have any advise/suggestions to improve my description or anything else don’t hesitate to let me know
Thanks in advance and thanks for a great module
Attachments: bill_corrupt_.xlsxbill_fresh_.xlsxCaptureerror_log.txtNote.txttest2.py