I 've opened Excel 2003 and create a simple spreadsheet. I enter =49000 as a
formula for A1 cell.

I then read the cell formula using POI. It returned -16536 instead of 49000.
I also attached the file.

 

What's happen? I don't believe on my eyes!

I am using POI 3.0 final on Windows XP.

 

    HSSFWorkbook workbook = new HSSFWorkbook(new
FileInputStream("c:\\SampleFiles\\simple_formula.xls"));

    HSSFSheet sheet = workbook.getSheetAt(0);

    HSSFRow row = sheet.getRow(0);

    HSSFCell cell = row.getCell((short)0);

    System.out.println("Formula:" + cell.getCellFormula());

 

//Formula:-16536

//will be printed out

// instead of 49000

Attachment: simple_formula.xls
Description: MS-Excel spreadsheet

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

Reply via email to