Decrypt excel files

Hi I have 1000 encrypted books that I would like to decrypt by providing pwd. I could not find the decryption method in apache poi or python xlrd module.

Does anyone know a library that could handle this ( wbc.decrypt(pwd)). I would prefer lib, which I could use from a unix window.

thank

+3
source share
2 answers

Use COM bindings to call a method Unprotect.

import win32com.client

excel = win32com.client.Dispatch('Excel.Application')

workbook = excel.Workbooks.open(r'c:\mybook.xls', 'password')

workbook.SaveAs('unencrypted.xls')

SaveAs may apply a new password. See: http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.saveas%28VS.80%29.aspx

+5
source
+1

Source: https://habr.com/ru/post/1737048/


All Articles