unable to close(); saves a corrupted workbook
See original GitHub issueimport xlsxwriter
workbook = xlsxwriter.Workbook('hello.xlsx')
worksheet = workbook.add_worksheet()
worksheet.write('A1', 'Hello world')
workbook.close()
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: ‘C:\Users\DOUGHE~1.ROS\AppData\Local\Temp\tmpnpp39a_c’
I was able to write excel files yesterday; today my day began with this issue and I was not able to resolve. I was hoping someone here may be of assistance.
If I run workbook.close() again, I do not receive the error, but the .xlsx file does not open and says it is corrupted.
I'm not sure what happened. I may have have closed/exited the program incorrectly. I've read of the importance of using workbook.close(), did I create a 'write to excel ghost' living in the purgatory of my temp folder? This issue now extends to pandas .to_excel() as well. I am able to write to csv.
I've restarted, reinstalled anaconda +packages, deleted all the tmp files in the temp folder, however I still receive this error. Any help would be greatly appreciated. Thank you.
windows 10
python 2.7, 3.6, 3.7 (I had base install of anaconda py 2.7, with an additional environment of 3.6. Reinstalled anaconda with python 3.7, 64bit. Issue happened with all three)
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (10 by maintainers)
Top Results From Across the Web
Repairing a corrupted workbook - Microsoft Support
Recover data from a corrupted workbook · Click the File tab, and then click Save As. · In the Save as type list,...
Read more >Fix Excel File Error 'Unable to Save Excel Workbook'
Methods to fix ?Unable to Save Excel Workbook? error: · Open a blank Excel File. Go to File and Click Open · Go...
Read more >How to diagnose Excel file corruption and repair workbooks
If a user opens a corrupted workbook in Excel 2013, while being oblivious that the file is damaged, the malfunction could be attributed...
Read more >Unable to Quit Excel - Small Business - Chron.com
If you have scanned your computer for viruses and malware and determined that add-ins are not preventing Excel from closing, you should perform...
Read more >Openpyxl Workbook.save function creates a corrupt and un ...
Openpyxl Workbook.save function creates a corrupt and un-openable Excel (.xlsx) file · The issue appears to be related to writing out ws. ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The file doesn’t appear to be open in Excel. At least, excel doesn’t seem to be running in task manager and I’ve not opened it. Here is the trace of the error:
Thanks for the feedback. I’ll close this issue.