problem:- python package pandas, openpyxl cant read excel with password protected.
action:- review decrypt excel files but still not working
result:- only pop-out password input box
problem:- python package pandas, openpyxl cant read excel with password protected.
action:- review decrypt excel files but still not working
result:- only pop-out password input box
Using:- Anaconda, jupyter notebook
What to do? read the encrypted excel and export as non-encrypting excel and proceed.
import win32com.client
excel = win32com.client.Dispatch('Excel.Application')
workbook = excel.Workbooks.Open(r'C:\ltexSales.xlsx',False, True, None, 'password')
xlCSVWindows = 0x17
workbook.SaveAs(r'C:\ltexSales_decrypted.csv', FileFormat = xlCSVWindows,
Password = None)
workbook.Close()
import pandas as pd
df = pd.read_csv(r'C:\ltexSales_decrypted.csv')
So now you may use pandas to read it.