Excel2007 Reader

Topics: User Forum
Aug 10, 2007 at 3:35 PM
i open an existing xlsx file and then write it
cell styles are lost along with some hidden dropdown definitions

the data input cells know they are a dropdown list, but there is nothing in the list

can you say when the reader will support these things?

mark
Coordinator
Aug 13, 2007 at 7:04 AM

mkaye wrote:
i open an existing xlsx file and then write it
cell styles are lost along with some hidden dropdown definitions

the data input cells know they are a dropdown list, but there is nothing in the list

can you say when the reader will support these things?

mark

If it's the same file as mentioned in http://www.codeplex.com/PHPExcel/Thread/View.aspx?ThreadId=13659, please let me know. Otherwise, I'd like to see a copy of that file too.

Regards,
Maarten
Aug 16, 2007 at 10:20 AM
Hi All,

My case is as under.

I do have a PHP site.I want to upload .xlsx file that is password protected(some cells).


I want to write to this file on cells that are not password protected and then read from a cell.

When I use load function it gives this error:
01:16:27 Read xlsx file PHPExcel object PHP Warning: ZipArchive::getFromName() function.ZipArchive-getFromName: Invalid or unitialized Zip object in D:\hema\Projects\year2007\projectsaug2007\rnd\1.4.0\Classes\PHPExcel\Reader\Excel2007.php on line 85 PHP Warning: Invalid argument supplied for foreach() in D:\hema\Projects\year2007\projectsaug2007\rnd\1.4.0\Classes\PHPExcel\Reader\Excel2007.php on line 86

I just want to write to two cells and read from three cells after writing to those two cells.

Any help and pointers will be highly appreciated.

Regards,
Satish
Coordinator
Aug 16, 2007 at 2:08 PM
Satish,

Next version will probably fix this. See homepage for announcements on that.

Regards,
Maarten
May 2, 2010 at 4:03 PM

I had the same problem and it was because the file was password protected, then to solve placing the password that you could modify it and ready to run

$str='123';
$objReader = new PHPExcel_Reader_Excel2007();   
 //cargamos el archivo excel(extensión *.xlsx)  
 $objPHPExcel = $objReader->load('../load/'.$nom_archivo);  
 $objPHPExcel->getSecurity()->setLockWindows(true);
 $objPHPExcel->getSecurity()->setLockStructure(true);
 $objPHPExcel->getSecurity()->setWorkbookPassword($str);
 $objPHPExcel->getActiveSheet()->getProtection()->setPassword($str);

Nov 22, 2010 at 11:25 PM

Tengo el siguiente problema:

Warning: ZipArchive::getFromName() [ziparchive.getfromname]: Invalid or unitialized Zip object in C:\AppServ\www\Klase\PHPExcel\Reader\Excel2007.php on line 327

Warning: Invalid argument supplied for foreach() in C:\AppServ\www\Klase\PHPExcel\Reader\Excel2007.php on line 328

Fatal error: Uncaught exception 'Exception' with message 'Active sheet index is out of bounds.' in C:\AppServ\www\Klase\PHPExcel.php:366 Stack trace: #0 C:\AppServ\www\ch03\excelmysql.php(41): PHPExcel->setActiveSheetIndex(0) #1 {main} thrown in C:\AppServ\www\Klase\PHPExcel.php on line 366

 

Estoy Ejecutando

<?php
// Clases Php
set_include_path(get_include_path().PATH_SEPARATOR.'/AppServ/www/Klase');
require_once("PHPExcel.php");
require_once("PHPExcel/Reader/Excel2007.php");
?>




<?php
$str='PHPExcel';
$archivo_loc="C:\TN/";
$archivo_nom="notas2.xlsx";
$objReader = new PHPExcel_Reader_Excel2007();
$objPHPExcel = $objReader->load($archivo_loc.$archivo_nom);
$objPHPExcel->getSecurity()->setLockWindows(true);
$objPHPExcel->getSecurity()->setLockStructure(true);
$objPHPExcel->getSecurity()->setWorkbookPassword($str);
$objPHPExcel->getActiveSheet()->getProtection()->setPassword($str);
$objPHPExcel->setActiveSheetIndex(0);
//$objWorksheet = $objPHPExcel->getActiveSheet();
?>


<?php
$i=10;
while($objPHPExcel->getActiveSheet()->getCell("A".$i)->getValue()!='')
{
$Lista = $objPHPExcel->getActiveSheet()->getCell("A".$i)->getValue();
$CEDULA = $objPHPExcel->getActiveSheet()->getCell("B".$i)->getValue();
$APENOM = $objPHPExcel->getActiveSheet()->getCell("C".$i)->getValue();
$NPL = $objPHPExcel->getActiveSheet()->getCell("Y".$i)->getValue();
$APL = $objPHPExcel->getActiveSheet()->getCell("Z".$i)->getValue();
$DPL = $objPHPExcel->getActiveSheet()->getCell("AA".$i)->getValue();
$IPL = $objPHPExcel->getActiveSheet()->getCell("AB".$i)->getValue();

$NPL = "";
$APL = "";
$DPL = "";
$IPL = "";

$NTL = "";
$ATL = "";
$DTL = "";
$ITL = "";


$conexion = mysql_connect('localhost', 'root', 'root');
$sql = "INSERT INTO notas1011 (Lista, CEDULA, $APENOM, NPL,APL,DPL,IPL,
NSL,ASL,DSL,ISL,NTL,ATL,DTL,ITL) VALUES ('$Lista','$CEDULA','$NPL','$APL','$DPL','$IPL',
'$NSL','$ASL','$DSL','$ISL','$NTL','$ATL','$DTL','$ITL')";
$rst=mysql_query($sql,$conexion); //Ejecutamos la SQL
if(!$rst) //Comprobamos si hay errores
        die("Error MySQL de Inserción de Datos");
$i++;
}
?>