1
I’m having trouble renaming an Excell file tab. I’m debugging and after it gives the set 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();
}
That’s exactly what it was. Thank you very much.
– Roknauta