Take the 2-minute tour ×

I am using Apache poi for generating excel data.It works fine for all cell types except formula type cell. The excel file with formula type cell when closed even without any changes throws a confirmatiorn like this.

For XLS fomat http://i40.tinypic.com/126d9uw.jpg

For XLSX format:


Is there any way to suppress this confirmation.

I tried the below code but it didnt help.

//Workbook wb = WorkbookFactory.create(new FileInputStream(absolutexlsFileName));
FileInputStream fis = new FileInputStream(absolutexlsFileName);
Workbook wb =  new XSSFWorkbook(fis);
FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();

OutputStream out = msg.getHttpServletResponse().getOutputStream();
msg.getHttpServletResponse().setHeader("Expires:", "0"); // eliminates browser caching
msg.getHttpServletResponse().setHeader("Content-Disposition", "attachment; filename="+absolutexlsFileName);
share|improve this question

1 Answer 1

Looks like your formula changes would cause a cell update somewhere but you don't calculate it (but excel does and thus the change confirmation). You have to evaluate your formulas in order to prevent that warning [1]

[1] http://poi.apache.org/spreadsheet/eval.html

share|improve this answer
I go through the document and got this setForceFormulaRecalculation(true).We are generating the excel in server and opening it in the client's machine using OutputStream. Please tell me how to use the above logic in my case. –  user1934095 Oct 21 '13 at 12:26
No, using setForceFormulaRecalculation will cause excel to update the document. You need to recalculate the cell's content using a FormulaEvaluator –  ooxi Oct 21 '13 at 12:37

Your Answer


