我能够从任何excel文件中读取数据,但是当我尝试将一些数据写入excel文件时,php文件不起作用..
我试过的代码:
<?php
include 'PHPExcel/IOFactory.php';
$fileType = 'Excel2007';
$fileName = 'output.xlsx';
$objReader = PHPExcel_IOFactory::createReader($fileType);
$objPHPExcel = $objReader->load($fileName);
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A1', 'Hello')
->setCellValue('B1', 'World!');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $fileType);
$objWriter->save($fileName);
?>
答案 0 :(得分:0)
将'output.xlsx'目标文件夹更改为完全权限777