1

Firstly, I am a bit of a newbie on Python but I am trying to open this password-protected file that I've had for a while and it comes up with an error 'Exception has occured:BadZipFile.'

Here is the code.

from openpyxl import load_workbook 

dir_file_path = './Copy of AA Listing - FB  06.09.2016 Rev L.xlsx'

workbook = load_workbook(dir_file_path)

workbook.security.lockStructure = False

workbook.save(dir_file_path)
workbook.close()
Moddy
  • 11
  • 1
  • 5

1 Answers1

1

I think openpyxl does not support opening password-protected excel files. Read answer to the following question it might help. How to open a password protected excel file using python?

Nick
  • 1,017
  • 1
  • 10
  • 16