is not recognised as an OLE file

Topics: Developer Forum, User Forum
Dec 18, 2009 at 8:26 AM

Hi! I'm from Russia, sorry for my English. I use PHExcel to read .xml file and i have problrm: "The filename /site/web/www/obr.xls is not recognised as an OLE file"? What does it mean? How can i solve this problem?

My script: http://6550101.ru/managers/test.php

My code:

 

/** PHPExcel */
include 'Classes/PHPExcel.php';

include 'Classes/PHPExcel/Reader/Excel5.php';


$excelFileName ="/site/web/www/obr.xls";
            
$objReader = new PHPExcel_Reader_Excel5();
$objPHPExcel = $objReader->load($excelFileName);


$objWorksheet = $objPHPExcel->getActiveSheet();

echo '<table>' . "\n";
foreach ($objWorksheet->getRowIterator() as $row) {
  echo '<tr>' . "\n";
        
  $cellIterator = $row->getCellIterator();
  $cellIterator->setIterateOnlyExistingCells(false); // This loops all cells,
                                                     // even if it is not set.
                                                     // By default, only cells
                                                     // that are set will be
                                                     // iterated.
  foreach ($cellIterator as $cell) {
    echo '<td>' . $cell->getValue() . '</td>' . "\n";
  }
 
  echo '</tr>' . "\n";
}
echo '</table>' . "\n";

Developer
Jan 20, 2010 at 10:27 AM

Marking as double post:

http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=78536