Bug 21885 - #VALUE! Error from setCellFormula("PPMT($C$7/1200, C11, $C$6, $C$5)");
Summary: #VALUE! Error from setCellFormula("PPMT($C$7/1200, C11, $C$6, $C$5)");
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.0-pre2
Hardware: PC All
: P3 normal with 5 votes (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks: 34973
  Show dependency tree
 
Reported: 2003-07-25 13:55 UTC by Jai Kang
Modified: 2008-05-05 13:42 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jai Kang 2003-07-25 13:55:32 UTC
Below is a part of my source codes to write formulas (PMT & PPMT) using the
setCellFormula. It works OK for PMT, but it does not with PPMT. When I open
the xls file, the cell has an error: ( #VALUE!) even though the formula bar
shows right formula (=PPMT($C$7/1200,C11,$C$6,$C$5). It is so strange that
the cell becomes OK when I either double click the cell itself, or press
Enter key at the end of the formula in the cell's formula bar.

HSSFRow r10 = sheet.createRow((short)10);
HSSFCell r10c3 = r10.createCell((short)3);
r10c3.setCellFormula("PMT($C$7/1200,$C$6,$c$5,0)");

HSSFCell r10c4 = r10.createCell((short)4);
r10c4.setCellFormula("PPMT($C$7/1200, C11, $C$6, $C$5)");
Comment 1 Josh Micich 2008-05-05 13:42:55 UTC
Re-tested OK in 3.1-beta1.

Bug was present until 3.0.2.  It looks like the bug was due to incorrect parameter operand classes.  That was fixed in bug 44675.