This is:
- [ ] a bug report
- [x] a feature request
XLS with file password protection should be readable.
Only default password ( VelvetSweatshop ) is used
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
<?php
require __DIR__ . '/vendor/autoload.php';
$filename = './data/Reader/XLS/with_password.xls';
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xls();
$reader->setWorkbookPassword('secret'); // or other method for set password
$sheet = $reader->load($filename);
// sheet should be loaded
1.2.0 - master
Has this been included in the current version?
This would solve a problem I am having.
Thanks.
+1 for workbook password, this would really help with GDPR. Been doing some research, perhaps password protected .ods would be easier as this is more documented than excel approach to password protection?
+1 for workbook protection with password for gdpr
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.
+1 This will help sending out GDPR complient email attachments!
+1, no news on this ?
still waiting for this to get fixed.
+1 mark. zip can do this, not expect
Can anyone please help me, I'm trying to unlock a password protected file with PHP. Can't find any library
You can try msoffcrypto-tool is a Python tool and library for decrypting encrypted MS Office files with a password. And use PhpSpreadsheet to read the unencrypted file in a temporary folder.
I used it in some projects, work great.
It would be great if PhpSpreadsheet has functionality to read password protected file with password specified..
I welcome you to check out my PHPDecryptXLSXWithPassword repo. It can decrypt an XLSX file with given password and generate an unprotected (open) XLSX file. Then you can use it with PHPSpreadsheet.
Edit: it also works on DOCX and PPTX files.
Most helpful comment
+1 for workbook password, this would really help with GDPR. Been doing some research, perhaps password protected .ods would be easier as this is more documented than excel approach to password protection?