Hi Axel.

Thank you very much, my problem is solved.

I had to add some lines to your code, but now it works perfect and very
quickly.
This is the final code.

if (cell.getCellType() == HSSFCell.CELL_TYPE_FORMULA) {
        Double numericCellValue = cell.getNumericCellValue();
        if (numericCellValue.isNaN()) {
                cell.setCellType(HSSFCell.CELL_TYPE_STRING);
                cell.setCellValue(cell.getRichStringCellValue());
        } else {
                cell.setCellType(HSSFCell.CELL_TYPE_STRING);
                cell.setCellValue(numericCellValue);
        }
}

On the other hand, I can explain you the purpose of evaluate cells values.
I need to have simple cells, cells with simple values and not formulas
because my formulas refer to cells in different sheets of the excell book.
In my application I need to delete some of these sheets so if I don't change
references for values in the new book (with only a few sheets) I will get a
lot of cell with reference to unexisting sheets, so I will get a lot of
Error cells. Furthermore after this preprocessing I will process the new and
simplified excell book using the OpenOffice.org API and it doesn't work
properly with all the excell functions but it works perfect with simple
value cells.

Thank you very much for you help.

Miguel.


-- 
View this message in context: 
http://www.nabble.com/Problem-evaluating-formulas-tp17642921p17644397.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to