Can i create save password protected Excel file with php? I find the a lot of class and method and did't found 开发者_如何学运维 thank you
You can use (the excellent) PHPExcel for this. To lock a whole workbook:
$reader = new PHPExcel_Reader_Excel2007;
$workbook = $reader->load("document.xlsx");
$workbook->getSecurity()->setWorkbookPassword("your password");
Or to lock a sheet:
$reader = new PHPExcel_Reader_Excel2007;
$workbook = $reader->load("document.xlsx");
$workbook->-getActiveSheet()->getSecurity()->setWorkbookPassword("your password");
Short answer: No you cannot create a password protected file from PHPExcel until now.
https://github.com/PHPOffice/PHPExcel/issues/442#issuecomment-57867961
精彩评论