How to read password protected Excel files using PHPExcel?

When trying to read a password protected file using PHPExcel, I got this error. I tried to insert a password into another PHPExcel function, but did not work. Please tell me how to open a password protected Excel file through PHPExcel.

There was a problem handling your file. Technical details: Cannot read encrypted file

My code

    $inputFileType = PHPExcel_IOFactory::identify(dirname(__FILE__) . '/../uploads/' . $model->report);
    $objReader = PHPExcel_IOFactory::createReader($inputFileType);
    if ($inputFileType != 'CSV') {
         $objReader->setReadDataOnly(true);
    }
    $objPHPExcel = $objReader->load(dirname(__FILE__) . '/../uploads/' . $model->report);
    $objWorksheet = $objPHPExcel->setActiveSheetIndex(0);
+4
source share
1 answer

PHPExcel - , , - PR, , Perl. , , - ; ... , xls.

+2

All Articles