问题
Is it possible to read and write xlsm with macros file with phpexcel?
I tested this code just to replicate the original file:
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objPHPExcel = $objReader->load("file1.xlsm");
echo ('Saving...');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('test.xlsm');
header('Cache-Control: max-age=0');
But the new file is different from the original because he has no images.
Thank you.
回答1:
PHPExcel doesnot support XLSM fully. Try converting XLSM to XLSX file
来源:https://stackoverflow.com/questions/29231309/phpexcel-xlsm-file-with-macros