I'm having trouble renaming the name of a tab in the Excell file. I am debugging and after it gives the set with the new name..I can see the new name changed in the execution but in practice the file itself is not changed. Someone?
private static void prepararPlanilha() {
try {
final int quantidadeAbas = AppUtils.workbook.getNumberOfSheets();
boolean possuiSheet = false;
for (int i = 0; i <= quantidadeAbas; i++) {
sheet = AppUtils.loadPlanilha(i);
if (sheet.getSheetName().length() > 2) {
AppUtils.workbook.setSheetName(i, sufixo);
}
if (sheet.getSheetName().equals(sufixo)) {
possuiSheet = true;
break;
}
}
if (!possuiSheet) {
AppUtils.workbook.createSheet(sufixo);
}
} catch (Exception e) {
System.out.println("Planilha inválida");
}
AppUtils.closeWorkbook();
}