import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.WorkbookFactory; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import java.io.*; public class Sample5_1{ public static void main(String[] args){ FileInputStream in = null; Workbook wb = null; try{ in = new FileInputStream("sample.xls"); wb = WorkbookFactory.create(in); }catch(IOException e){ System.out.println(e.toString()); }catch(InvalidFormatException e){ System.out.println(e.toString()); }finally{ try{ in.close(); }catch (IOException e){ System.out.println(e.toString()); } } Sheet sheet = wb.getSheetAt(0); Row row = sheet.getRow(1); Cell cell = row.getCell(1); row.removeCell(cell); FileOutputStream out = null; try{ out = new FileOutputStream("sample5_1.xls"); wb.write(out); }catch(IOException e){ System.out.println(e.toString()); }finally{ try { out.close(); }catch(IOException e){ System.out.println(e.toString()); } } } }