|Summary:||values dont get copied to another sheet.|
|Component:||HSSF||Assignee:||POI Developers List <dev>|
Description Hansj 2002-09-17 10:42:43 UTC
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?
Comment 1 Andy Oliver 2002-09-17 10:57:09 UTC
upgrade to 1.5.1.
Comment 2 Hansj 2002-09-17 17:50:59 UTC
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.
Comment 3 Glen Stampoultzis 2002-09-18 10:19:45 UTC
I have a theory it might be fixed by some changed I checked in against head. Can you test against a nightly build please?
Comment 4 Hansj 2002-09-19 07:31:14 UTC
I checked with jakarta-poi-1.8.0-dev-20020919.jar but the problem remains the same.
Comment 5 Avik Sengupta 2003-10-28 18:07:50 UTC
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();