我正在尝试使用java删除带有jxl jar文件的excel表。但我无法理解如何做到这一点。我没有在jxl
中获得任何删除或删除方法答案 0 :(得分:0)
您可以使用removeSheet方法删除工作表... 示例代码,
public static String removeWorksheet(String p_filename,
int p_index) throws Exception
{
try
{
Workbook oldwb = Workbook.getWorkbook(new File(p_filename));
WritableWorkbook wb = (WritableWorkbook) Workbook.createWorkbook(new File(p_filename),oldwb);
wb.removeSheet(p_index);
wb.write(); // Don't forget this...
wb.close();
return "success";
}
catch(Exception e)
{
return "error"+e+e.getMessage();
}
}
}
答案 1 :(得分:0)
Ne需要JXL删除excel文件,你可以用java来实现它。很容易