PHPExcel setFormula1 ( If a lot does not work)

Mar 15, 2012 at 7:44 AM

$ary=array('CASUAL','ROCK','ffff',...);  //If a lot does not work
$objPHPExcel = new PHPExcel();
$activeSheet = $objPHPExcel->getActiveSheet();

$objValidation = $activeSheet->getCell("A1")->getDataValidation();
$objValidation->setType( PHPExcel_Cell_DataValidation::TYPE_LIST )
->setErrorStyle( PHPExcel_Cell_DataValidation::STYLE_INFORMATION )
->setFormula1('"'. $selectItems .'"'); 

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









Aug 17, 2012 at 11:29 AM


I think you have some code like this

$objWriter = PHPExcel_IOFactory::createWriter($this->objPHPExcel, 'Excel2005');

if you change Excel2005 to Excel2007

Aug 17, 2012 at 11:30 AM

And at excel2007, if you make a dropdownlist, the data max length is 265