------------------------------------------------------------------------------------
Hi,

I have a excel file with many sheets in it.
It has various formulas, dropdowns in it.
I have tried to update a cell in it by code.

            POIFSFileSystem fs = new POIFSFileSystem(new
FileInputStream("c:\\Try.xls"));
            HSSFWorkbook wb = new HSSFWorkbook(fs);
            HSSFSheet sheet = wb.getSheet("Try Sheet");
            HSSFRow row = sheet.getRow(3);
            HSSFCell cell = row.getCell((short) 2);

            if (cell == null) {
                cell = row.createCell((short) 2);
            }
            
            cell.setCellType(HSSFCell.CELL_TYPE_STRING);
            HSSFRichTextString str = new HSSFRichTextString("My Project
Name");
            cell.setCellValue(str);

            FileOutputStream fileOut = new FileOutputStream("c:\\Try.xls");
            wb.write(fileOut);
            fileOut.close(); 


After executing this excel file gets damaged.
It shows only text content.
All colors, drpdowns disapears.

Please suggest me the solution over it.

------------------------------------------------------------------------------------
 
-- 
View this message in context: 
http://www.nabble.com/How-to-update-cell%28s%29-in-excel-files---tp19738477p19738477.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to