Working with XLS Files: loss of DropDowns

Topics: Developer Forum, Project Management Forum, User Forum
Mar 16, 2010 at 10:15 AM
Edited Mar 16, 2010 at 10:21 AM


im trying to open an existing XLS File, put some data into it and save this document with another name.

In the original XLS are some DropDown fields with 3-4 values. (Which i don't change)

If i open the new generated XLS File these DropDown functions are not more available.


Here the code:

    $objReader = PHPExcel_IOFactory::createReader('Excel5');

    $objPHPExcel = $objReader->load("files/org_file.xls");        

    $objPHPExcel->getActiveSheet()->setCellValue("I4", "value");
    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
    $tempfile = "files/temp_".date("dmY_His").".xls";
    catch(Exception $exc)
        echo "<br>".$exc;

In org_file.xls the DropDown is available, but is lost in the new temp_xxx.xls.

Where is the problem?


Thank you.


Mar 16, 2010 at 10:34 AM

If those drop-downs are data validation objects then be aware that Excel5 reader/writer in PHPExcel 1.7.2 does not support data validation.

Try with latest source code:

Mar 16, 2010 at 10:42 AM

Thank you for your fast answer!

So its not possible, not now, not in future to do this?

Can i send you this excel file via email?


Maybe there is a work around?

I want to let all fields what they are and want to put data only into some empty fields.


Thank you very much!



Mar 16, 2010 at 10:56 AM
FlorianH wrote:

So its not possible, not now, not in future to do this?

It is possible if you use latest source code instead of PHPExcel 1.7.2. Download from here: