Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading password-protected Excel #254

Open
darrencl opened this issue Feb 15, 2024 · 0 comments
Open

Reading password-protected Excel #254

darrencl opened this issue Feb 15, 2024 · 0 comments

Comments

@darrencl
Copy link

Hi, I am currently using this library to read an Excel sheet.

Now, I would like to read a password-protected Excel file, is there any way to do this?

Currently in Python, I use the following solution. Is there any equivalent way in Julia, or is it just not doable at this stage?

import io
import pandas as pd
import msoffcrypto

passwd = 'xyz'

decrypted_workbook = io.BytesIO()
with open(path_to_your_file, 'rb') as file:
    office_file = msoffcrypto.OfficeFile(file)
    office_file.load_key(password=passwd)
    office_file.decrypt(decrypted_workbook)

df = pd.read_excel(decrypted_workbook, sheet_name='abc')

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant