excelfile read, change and save

Topics: Developer Forum, Project Management Forum, User Forum
Sep 26, 2013 at 7:50 AM
Edited Sep 26, 2013 at 8:01 AM
hello,

i will a excel file read, then change and then save.
        require_once("_libraries/PHPExcel_1.7.8/Classes/PHPExcel.php");
        require_once("_libraries/PHPExcel_1.7.8/Classes/PHPExcel/IOFactory.php");
        require_once("_libraries/PHPExcel_1.7.8/Classes/PHPExcel/Writer/Excel2007.php");

        $inputFileName = 'files/test.xlsx';
        
        $objReader = PHPExcel_IOFactory::createReader($inputFileName);
        $objPHPExcel = $objReader->load($inputFileName);
        
        $objPHPExcel->setActiveSheetIndex(1);
        $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(3, 10, 'This is a test');    
        
        $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
        $objWriter->save($inputFileName);
But i get the following errormessages:
Fatal error: Class 'PHPExcel_Reader_files/test.xlsx' not found in ... PHPExcel/IOFactory.php on line 170
But the file is in this directory, what i doing wrong?
Coordinator
Sep 26, 2013 at 1:19 PM
If PHPExcel is returning a "file not found" error, then either the file isn't in that directory, or PHP doesn't have permission to read the file