Hi All,
I want to write in an existing excel(in sheet1) file in a perticular cell(say row=1,cell=6). I'm using poi jar. But I could not write in that perticular cell.
String val= //value that I want to write;
String filePath = //getting the filepath. ;
File file=new File(filePath);
FileInputStream fis=new FileInputStream(file);
HSSFWorkbook wb=new HSSFWorkbook(fis);
HSSFSheet st=wb.getSheet("Sheet1");
HSSFRow row=st.getRow(1);
HSSFCell cell= row.getCell(6);
cell.setCellValue(val);
fis.close();
This should write val to sheet1, row 1 cell 6 of the perticular excel that I'm passing. In filepath I'm passing file path along with file name.
But this is not working though not throwing any errors.
Could someone please help?