Error saving an excel with PHP excel

0

I'm trying to modify an excel template using php and when I try to save the file it sends me this error:

  

Fatal error: Uncaught PHPExcel_Exception: Invalid cell coordinate   CHUY1 in   C: \ xampp \ htdocs \ SiGGa \ lib \ PHPExcel \ Classes \ PHPExcel \ Cell.php: 594 Stack   trace: # 0   C: \ xampp \ htdocs \ SiGGa \ lib \ PHPExcel \ Classes \ PHPExcel \ Cell.php (651):   PHPExcel_Cell :: coordinateFromString ('CHUY1') # 1   C: \ xampp \ htdocs \ SiGGa \ lib \ PHPExcel \ Classes \ PHPExcel \ Cell.php (624):   PHPExcel_Cell :: absoluteCoordinate ('CHUY1') # 2   C: \ xampp \ htdocs \ SiGGa \ lib \ PHPExcel \ Classes \ PHPExcel \ Writer \ Excel2007 \ Workbook.php (323):   PHPExcel_Cell :: absoluteReference ('CHUY1') # 3   C: \ xampp \ htdocs \ SiGGa \ lib \ PHPExcel \ Classes \ PHPExcel \ Writer \ Excel2007 \ Workbook.php (300):   PHPExcel_Writer_Excel2007_Workbook- > writeDefinedNameForNamedRange (Object (PHPExcel_Shared_XMLWriter),   Object (PHPExcel_NamedRange)) # 4   C: \ xampp \ htdocs \ SiGGa \ lib \ PHPExcel \ Classes \ PHPExcel \ Writer \ Excel2007 \ Workbook.php (269):   PHPExcel_Writer_Excel2007_Workbook-> writeNamedRanges (Object (PHPExcel_Shared_XMLWriter),   Object (PHPExcel)) # 5   C: \ xampp \ htdocs \ SiGGa \ lib \ PHPExcel \ Classes \ PHPExcel \ Writer \ Excel2007 \ Workbook.php (75):   PHPExcel_Writer in   C: \ xampp \ htdocs \ SiGGa \ lib \ PHPExcel \ Classes \ PHPExcel \ Cell.php on line   594

The code I use is the following

   $objPHPExcel = new PHPExcel();
    //Creamos un objeto para leer el archivo
    $objReader = PHPExcel_IOFactory::createReader('Excel2007');
    //Cargamos el archivo a leer
    $objPHPExcel = $objReader->load('Presupuestos_Creados/CALSONIC - NMX A1/Plantilla/FORMATO DE PRESUPUESTO CALSONIC.xlsx');

    //Moodificaciones a la pestaña 1 del archivo excel
    $objPHPExcel->setActiveSheetIndex(0);

    //Modificamos la plantilla
    $objPHPExcel->getActiveSheet()->SetCellValue("B7","Proyecto");


    //Creamos un objeto para escribir en el archivo excel
    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel,'Excel2007');

    //Guargamos el archivo en la ruta especificada
    $objWriter->save('nuevo_archivo.xlsx');

Previously I had already used this code with other templates and it had worked for me but with this one in spice I sent this error

I hope you can help me

    
asked by L. Diaz 11.05.2017 в 18:44
source

0 answers