I'm trying to update an existing Excel file. I used the code I saw here Writing to an Existing Excel File but I can't call the function from the main activity.
I tried to create a instance from the department.
It is my code of the class
public class ExceLJxL {
public ExceLJxL(){
}
public static void WriteFile(String path) throws BiffException, IOException, RowsExceededException, WriteException {
Workbook wb = Workbook.getWorkbook(new File(path));
WritableWorkbook copy = Workbook.createWorkbook(new File("D:\temp.xls"), wb);
WritableSheet sheet = copy.getSheet(1);
WritableCell cell;
Label l = new Label(1, 1, "");
cell = (WritableCell) l;
sheet.addCell(cell);
copy.write();
copy.close();
wb.close();
}
}
And here I call the function
ExceLJxL exceLJxL= new ExceLJxl();
exceLJxL.WriteFile( "path");
But he doesn't know it