I have a workbook with two sheets. Cells on sheet 1 point to sheet2 (like <=sheet2!A2>) I can put Values via POI(HSSF-usermodel) onto sheet 2. After opening the workbook with Excel I can see the values on sheet2, but no values are on Sheet1. After pressing F2 the values appear. Is there any way to get arround this?
upgrade to 1.5.1.
Sorry for my bad explanation. I will try harder. I have a workbook with two sheets. On one sheets I put some formulas to calculate - for example - the average of some cells on the other sheet. This is all done once using the spreadsheet prog. Then I want to fill in the values via POI onto the input sheet (not touching the sheet with the formulas). This works fine. When you reopen the workbook you can see the input on the one sheet, but the formulas on the second sheet do not get updated unless you walk through by hand. Putting the formulas onto the same sheet doesnot help: the sheet gets corrupted. I hope this explanation is little bit better than before. If not please feel free to contact me via email so I can give better explanation, code example or files. Thank you for you patience.
I have a theory it might be fixed by some changed I checked in against head. Can you test against a nightly build please?
I checked with jakarta-poi-1.8.0-dev-20020919.jar but the problem remains the same.
Works for me.. Excel2002, following code, no need to press F2, excel sheet has empty Sheet1, "=Sheet1!A1" in Sheet2!A1 String filename="12730.xls"; FileInputStream in = new FileInputStream(filename); HSSFWorkbook wb = new HSSFWorkbook(in); HSSFSheet sheet = wb.getSheetAt(0); HSSFRow row = sheet.getRow(0); if (row==null) row=sheet.createRow(0); HSSFCell cell = row.getCell((short)0); if (cell==null) cell=row.createCell((short)0); cell.setCellValue(1.0); File f = new File("test12730.xls"); FileOutputStream fileOut = new FileOutputStream(f); wb.write(fileOut); fileOut.close();
*** Bug 17196 has been marked as a duplicate of this bug. ***