Trouble with copySheet and addcellvalue

Topics: Developer Forum, Project Management Forum, User Forum
Dec 7, 2010 at 4:53 PM

Hi , my name is ildefonso I'm from Mexico, I recently start to use PHPExcel and I have a little problem.

I have a template, and I copy the fist sheet then I add to the woorkbook, like this.


$reader = new PHPExcel_Reader_Excel5();
$excel = $reader->load("pta-plantilla.xls");

$sheet = $excel->getActiveSheet();
$nuevo =  clone $sheet;


$otro = clone $nuevo;

$titulo= "META 1";
$otro->setCellValue('BG11',1)->setCellValue('A21', $metas[0])->setCellValue('BA11', 33);

$otro1= clone $nuevo;

$otro1->setCellValue('BG11',2)->setCellValue('A21', $metas[1])->setCellValue('BA11', 33);
$titulo= "META 2";

$objWriter = PHPExcel_IOFactory::createWriter($excel, 'Excel5');

Then the result is 2 sheets One with title="Meta 1" the other one with title="Meta 2"     but here is the thing,  two sheet shows me the same info,  in this case the info contain in "META 2"


Thanks, I dont know if it is a bug o what is going on ...

Dec 7, 2010 at 10:30 PM

Please see my latest response to this discussion