如何让phpexcel生成的excel文件打开时需要密码
如题。
我搜索网上的一些解决方案说可以这样:
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$objPHPExcel=new PHPExcel();$objPHPExcel->getSecurity()->setLockWindows(true);$objPHPExcel->getSecurity()->setLockStructure(true);$objPHPExcel->getSecurity()->setWorkbookPassword("abc");$objWriter=new PHPExcel_Writer_Excel5($objPHPExcel);$objWriter->setTempDir(".");$objWriter->save("abc.xls");