尝试使用 PHPExcel 读取受密码保护的文件时,出现此错误。我尝试将密码粘贴到 PHPExcel 的不同功能中,但没有成功。请告诉我如何通过 PHPExcel 打开受密码保护的 Excel 文件。
There was a problem handling your file. Technical details: Cannot read encrypted file
我的代码
$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);