Ver Mensaje Individual
  #4 (permalink)  
Antiguo 25/05/2012, 15:26
Avatar de enlinea777
enlinea777
 
Fecha de Ingreso: mayo-2008
Ubicación: frente al pc
Mensajes: 1.830
Antigüedad: 15 años, 11 meses
Puntos: 127
Respuesta: problemas con PHPExcel

a mi me funciona mira mi ejemplo: leer_excel.php
prueba esto:

Código PHP:
error_reporting(E_ALL);
set_time_limit(0);
echo 
"entra<br>";
require_once 
'PHPExcel/IOFactory.php';
echo 
"require ok<br>";
$objPHPExcel PHPExcel_IOFactory::load("Agencias.xls");
echo 
"loaded ok <br>"
foreach (
$objPHPExcel->getWorksheetIterator() as $worksheet) {
$worksheetTitle $worksheet->getTitle();
$highestRow $worksheet->getHighestRow(); // e.g. 10
$highestColumn $worksheet->getHighestColumn(); // e.g 'F'
$highestColumnIndex PHPExcel_Cell::columnIndexFromString($highestColumn);
$nrColumns ord($highestColumn) - 64;
echo 
"<br>The worksheet ".$worksheetTitle." has ";
echo 
$nrColumns ' columns (A-' $highestColumn ') ';
echo 
' and ' $highestRow ' row.';
echo 
'<br>Data: <table border="1"><tr>';
for (
$row 1$row <= $highestRow; ++ $row) {
echo 
'<tr>';
for (
$col 0$col $highestColumnIndex; ++ $col) {
$cell $worksheet->getCellByColumnAndRow($col$row);
$val $cell->getValue();
$dataType PHPExcel_Cell_DataType::dataTypeForValue($val);
echo 
'<td>' $val '<br>(Typ ' $dataType ')</td>';
}
echo 
'</tr>';
}
echo 
'</table>';