i accomplished the read of excel with php but the write i cannot, i not know why.. in the file to read, take one column and write in a new file excel and paste there is.. for now only that.. Thank to all..
<?php require_once "excel/Classes/PHPExcel.php"; require_once "excel/Classes/PHPExcel/IOFactory.php"; mb_internal_encoding('UTF-8'); mb_http_output('UTF-8'); set_time_limit ( 0 ); ini_set('memory_limit', '-1'); error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); ?> <form action="" method="post" enctype="multipart/form-data"> Desea comenzar el proceso ? <input type="submit" value="Aceptar" name="submit"> </form> <?php if(isset($_POST['submit'])){ $objPHPExcel_load = new PHPExcel(); $PHPExcel_save = new PHPExcel(); $PHPExcel_save->getProperties()->setCreator("Maarten Balliauw") ->setLastModifiedBy("Maarten Balliauw") ->setTitle("Office 2007 XLSX Test Document") ->setSubject("Office 2007 XLSX Test Document") ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") ->setKeywords("office 2007 openxml php") ->setCategory("Test result file"); $PHPExcel_save->setActiveSheetIndex(0) ->setCellValue('A1', 'Cedula'); $PHPExcel_save->getActiveSheet()->setTitle('Simple'); $PHPExcel_save->setActiveSheetIndex(0); $inputFileName = 'discussdesk.xlsx'; $objPHPExcel_load = PHPExcel_IOFactory::load($inputFileName); $objWorksheet = $objPHPExcel_load->getActiveSheet(); $cantidad = $objWorksheet->getHighestRow();// tamaño de los registros $objeto_pegar = $PHPExcel_save->getActiveSheet(0); echo "cantidad : ".$cantidad; $prueba = true; $row = 2; $column = 1; for($i = 1;$i <= $cantidad;$i++){ $celda = trim($objWorksheet->getCellByColumnAndRow(7, $row)->getValue()); $PHPExcel_save->setActiveSheetIndex(0)->setCellValueByColumnAndRow(1, $row, $celda); echo $celda.'<br>'; if(is_null($celda)){ break; } $row +=1; } $PHPExcel_save->setActiveSheetIndex(0); header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="01simple.xlsx"'); header('Cache-Control: max-age=0'); // If you're serving to IE 9, then the following may be needed header('Cache-Control: max-age=1'); // If you're serving to IE over SSL, then the following may be needed header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1 header ('Pragma: public'); // HTTP/1.0 $objWriter = PHPExcel_IOFactory::createWriter($PHPExcel_save, 'Excel2007'); $objWriter->save('php://output'); } ?>