I am trying to update some entries in existing excel sheet .Below is my code
System.out.println("Update excel block");
FileInputStream fsIP= new FileInputStream("C:\\Users\\SXR8036\\Downloads\\LANE-804.xls");
// System.out.println(Path);
System.out.println("Trying to update the file");
HSSFWorkbook wb = new HSSFWorkbook(fsIP);//Access the workbook
HSSFSheet worksheet = wb.getSheetAt(0);//Access the worksheet, so that we can update / modify it
Cell cell = null;
cell = worksheet.getRow(2).getCell(2);// Access the second cell in second row to update the value
cell.setCellValue("OverRide Last Name");
fsIP.close(); //Close the InputStream
FileOutputStream output_file =new FileOutputStream(new File("C:\\Users\\SXR8036\\Downloads\\LANE-804.xls")); //Open FileOutputStream to write updates
wb.write(output_file); //write changes
output_file.close(); //close the stream
I am getting NUll pinter exception as error >i have read quite about null pointer exception now but not able to find a solution to this.