cell validation

Topics: Developer Forum, User Forum
Jul 14, 2011 at 2:45 PM

Good morning.
Please could someone tell me why the attached code that activates the validation in cell G11, but only to validate if the data entered is numeric and not validate the range (between 4 and 70)?
If I put numbers, accepts anyone, even outside the range.
If I put letters, not accept them.
Thank you very much.

$objValidation = $objPHPExcel->getActiveSheet()->getCell('G11')->getDataValidation();
$objValidation->setType( PHPExcel_Cell_DataValidation::TYPE_WHOLE );
$objValidation->setOperator( PHPExcel_Cell_DataValidation::OPERATOR_BETWEEN);
$objValidation->setErrorStyle( PHPExcel_Cell_DataValidation::STYLE_STOP );
$objValidation->setErrorTitle('Solo numeros entre 4 y 70');
$objValidation->setError('Solo numeros entre 4 y 70!');
$objValidation->setPromptTitle('Datos permitidos');
$objValidation->setPrompt('Solo numeros entre 4 y 70');

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