I am getting Call to undefined method PHPExcel_Calculation::_getMatrixDimensions() Eroor when set value a export excel sheet in cakephp using PHPEXCEl

MY CODE

$type = PHPExcel_IOFactory::identify($gst_file); $excel2 = PHPExcel_IOFactory::createReader($type);

            $excel2 = $excel2->load($gst_file);

            $excel2->setActiveSheetIndex(0);

            $excel2->getActiveSheet()->setCellValue('C11', 1500)
                ->setCellValue('D11', 100);



                ob_end_clean();

            header('Content-Type: application/vnd.ms-excel');
            header('Content-Disposition: attachment;filename="gstr_one_To.xlsx"');
            header('Cache-Control: max-age=0');

            header('Cache-Control: max-age=1');


            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');
            header ('Pragma: public'); 
            $objWriter = PHPExcel_IOFactory::createWriter($excel2, 'Excel5');

            $objWriter->save('php://output');

0 Answers