Uncaught exception 'PHPExcel_Calculation_Exception' Formula Error: An unexpected error occured '

0

I'm working with the PHPExcel library and I'm trying to extract the data from an excel file using the getCalculatedValue() function, but that error comes out:

  

(Uncaught exception 'PHPExcel_Calculation_Exception' Formula Error:   An unexpected error occured ').

I do not know if it has anything to do with some data from the cells I'm trying to extract from another different sheet (from the same excel file). Here is part of the code that I am using.

$objPHPExcel = PHPExcel_IOFactory::load($nombreArchivo);
    $objPHPExcel->setActiveSheetIndex(8);

$numRows = $objPHPExcel->setActiveSheetIndex(8)->getHighestRow();

echo '<table border=1> 
    <tr>
        <td> Clave </td>
        <td> Nombre Curso </td>
        <td> Clave Area </td>
        <td> Area </td>
        <td> Clasificacion </td>
        <td> Descripcion </td>
    </tr>';

$objPHPExcel = PHPExcel_IOFactory::load($nombreArchivo);
$objPHPExcel->setActiveSheetIndex(8);

$numRows = $objPHPExcel->setActiveSheetIndex(8)->getHighestRow();

echo '<table border=1> 
    <tr>
        <td> Clave </td>
        <td> Nombre Curso </td>
        <td> Clave Area </td>
        <td> Area </td>
        <td> Clasificacion </td>
        <td> Descripcion </td>
    </tr>';

for ($i=2; $i <= $numRows; $i++) { 
        $Clave = $objPHPExcel->getActiveSheet()->getCell('A'.$i)->getCalculatedValue(); 
        $NombreCurso = $objPHPExcel->getActiveSheet()->getCell('B'.$i)->getCalculatedValue();
        $ClaveArea = $objPHPExcel->getActiveSheet()->getCell('D'.$i)->getCalculatedValue();
        $Area = $objPHPExcel->getActiveSheet()->getCell('E'.$i)->getCalculatedValue();
        $Clasificacion = $objPHPExcel->getActiveSheet()->getCell('F'.$i)->getCalculatedValue();
        $Descripcion = $objPHPExcel->getActiveSheet()->getCell('G'.$i)->getCalculatedValue();
}
    
asked by jorge 26.09.2018 в 21:59
source

0 answers