Unable to delete last column on Windows

Issue #995 resolved
Andrew Kisel
created an issue

Today I noticed some weird issue that for some reason last column in my file (and any test file I created with similar structure) is not being deleted with 'delete_cols()'. Any other column is deleted fine. The files I tested on Windows were created on Windows machines.

Code that I used for testing on both Windows and Mac:

wb = openpyxl.load_workbook('Test_data.xlsx')
ws = wb.active
ws.delete_cols(5)
wb.save('Test.xlsx')

On Windows it simply does not change anything and on Mac it removes any column just fine.

I use Python 3.6.3 on Windows and Python 3.6.2 on Mac.

Comments (13)

  1. CharlieC

    I'm certain that the problem has nothing to do with openpyxl on Windows vs. Mac. Can you try with a checkout of the 2.5 branch and see if the problem persists? This contains changes to how rows and columns are deleted when deleting happens at the end of the sequence.

  2. Alex Spurling

    Just want to say thank you for fixing this bug and generally maintaining the library. I was confused for a while why row deletion was not working as expected before I found this bug report. Upgrading to 2.5.3 has fixed my issues. I really appreciate your good work!

  3. Log in to comment