I am dynamically creating excel file with dropdown's using PHPExcel but when i am opening file in windows excel it is giving validation error and removes dropdown although it is working perfectly file in libra office.!
$this->dropdownInExcel($activeSheet,"yes,no","A2");
public function dropdownInExcel($activeSheet,$values,$columnNum){
$objVal = $activeSheet->getCell($columnNum)->getDataValidation();
$objVal->setType( PHPExcel_Cell_DataValidation::TYPE_LIST );
$objVal->setErrorStyle( PHPExcel_Cell_DataValidation::STYLE_INFORMATION );
$objVal->setAllowBlank(false);
$objVal->setShowInputMessage(true);
$objVal->setShowErrorMessage(true);
$objVal->setShowDropDown(true);
$objVal->setErrorTitle('Input error');
$objVal->setError('Value is not in list.');
$objVal->setPromptTitle('Pick from list');
$objVal->setPrompt('Pick a value from the drop-down list.');
$objVal->setFormula1($values);
}
I am dynamically creating excel file with dropdown's using PHPExcel but when i am opening file in windows excel it is giving validation error and removes dropdown although it is working perfectly file in libra office.!