小编use*_*294的帖子

使用Apache POI删除HSSF工作表的数据验证

如何通过使用Apache POI删除Excel的数据验证。我有以下代码。在第一次运行时,将正确创建下拉列表,但是一旦我以字符串列表中的不同值再次运行该程序,该下拉列表就不会得到更新。

FileInputStream fsIP= new FileInputStream(new File("D:\\template3.xls")); //Read the spreadsheet that needs to be updated              
                HSSFWorkbook wb = new HSSFWorkbook(fsIP); //Access the workbook           
                HSSFSheet worksheet = wb.getSheetAt(0); //Access the worksheet, so that we can update / modify it.
          //     System.out.println(worksheet.getRow(1).getCell(2));
                Cell cell = null; // declare a Cell object                
                DataValidation dataValidation = null;
                DataValidationConstraint constraint = null;
                DataValidationHelper validationHelper = null;
                CellRangeAddressList addressList = new  CellRangeAddressList(0,5,0,5);

                //cell = worksheet.getRow(2).getCell(2);   // Access the second cell in second row to update the …
Run Code Online (Sandbox Code Playgroud)

java apache excel

5
推荐指数
1
解决办法
1037
查看次数

标签 统计

apache ×1

excel ×1

java ×1