Dnia 4 lutego 2013 12:36 Nick Burch <[email protected]> napisaƂ(a):
> 
> > On Mon, 4 Feb 2013, zephod wrote:
> > I using Apache POI for Java to set formulas in Excel cells. I'm using 
> > the following code to make the formulas appear as formulas rather than 
> > as Strings:
> >
> >  // "cell" object previously created or looked up
> >  String StrFormula = "SUM(\"A1:A10\")";
> >  cell.setCellType(HSSFCell.CELL_TYPE_FORMULA);
> >  cell.setCellFormula(strFormula);
> 
> You shouldn't need to set the cell type, the setCellFormula call will do 
> that for you
> 
> > There are some functions (introduced in Excel 2007) like SUMIFS, 
> > COUNTIFS. IFERROR, AVERAGEIFS that cause the cell to contain a String. 
> > It is necessary to click+enter every such cell in Excel for the formula 
> > to get recognized.
> 
> Are you triggering a formula recalculation at the end of the processing of 
> the file? Excel caches formula values, so you'll need to update those when 
> you're done making changes
> 
No, I'm just constructing a spreadsheet with formulas and store it in a file. 
Formulas with some functions work OK, but the ones with the new functions that 
I listed don't. How would I trigger the recalculation you suggest? Why some 
formulas work and others not?

Kind regards,
Jacek

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to