Reputation: 133
I have 35 protected workbook. I'm using PHPExcel to extract information from respective excel files. Unfortunately, PHPExcel failed to load the file I suspect due to protected workbook. Here's my code:
$inputFileType = PHPExcel_IOFactory::identify($inputFileName);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load($inputFileName);
Is there any workaround to enable PHPExcel to extract the information from protected workbook?
Thanks in advance.
Upvotes: 3
Views: 2506
Reputation: 212412
Note that from version 1.8.0, PHPExcel does support reading protected Excel5 workbooks. It isn't covered in the documentation because you don't need to do anything special, PHPExcel simply decrypts the document as it reads it
Note that this doesn't apply to documents with a user password, but "VelvetSweatshop" protected documents
http://meindertjan.nl/2012/08/22/microsoft-offic-and-its-velvetsweatshop-password-protected-files/
Upvotes: 3
Reputation: 54212
In short, PHPExcel does not support protected sheets / workbook . See: http://phpexcel.codeplex.com/discussions/244865
Upvotes: 0