0

I have to create an application in java to help filling data in Excel file with multiple sheets. The problem is I need to call my function write every time I insert data and currently everytime it does replace my actual file by an new one.

I searched on google some answers but I could'nt find anything. Currently for testing if an Excel Sheet exist I'm doing that :

    if(workbook.getSheet(Nom[0]) != null){
       workbook.createSheet(Nom[0], 0);
                }

But the real problem come when I only want to write in an existing Excel file :

if(file.exists() && !file.isDirectory()) 
            workbook = Workbook.getWorkbook(file);
        else
            workbook = Workbook.createWorkbook(file,wbSettings);

And the method getWorkbook return Workbook type instead of WritableWorkbook.

What should I do to write in an existing Excel file ?

Thank you

LoP Castro
  • 25
  • 8
  • answered here: http://stackoverflow.com/questions/3605923/modifying-existing-excel-using-jxl and here: http://stackoverflow.com/questions/24260354/how-to-edit-modify-an-existing-excel-file-in-java-with-jexcel-api – destan Apr 14 '17 at 07:14
  • Thanks destan these threads are really helpfull ! – LoP Castro Apr 14 '17 at 07:56

0 Answers0