Hi,
The aspose cells version used is aspose-cells-8.6.2
Hi,
Thanks for your posting and using Aspose.Cells.
We have tested this issue with the following sample code using the latest version: Aspose.Cells for Java (Latest Version). It loads your excel file and generates the exception as you mentioned.
We have logged this issue in our database for investigation. We will look into it and fix this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.
This issue has been logged as
- CELLSJAVA-41630 - Could not load the excel sheet
I have also shown the exception for a reference.
Java
String filePath = “F:\Shak-Data-RW\Downloads\testFile.xlsx”;
Workbook workbook = new Workbook(filePath);
Exception:
Exception in thread “main” java.lang.IllegalArgumentException: Index is out of range.
at com.aspose.cells.Workbook.changePalette(Unknown Source)
at com.aspose.cells.zajw.m(Unknown Source)
at com.aspose.cells.zajw.n(Unknown Source)
at com.aspose.cells.zajw.a(Unknown Source)
at com.aspose.cells.zakb.s(Unknown Source)
at com.aspose.cells.zakb.a(Unknown Source)
at com.aspose.cells.zaka.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)
at clsAsposeCells.f1(clsAsposeCells.java:28)
at clsAsposeCells.main(clsAsposeCells.java:11)
Hi,
Thanks for using Aspose.Cells.
It is to inform you that we have fixed your issue CELLSJAVA-41630 now. We will soon provide the fix after performing QA and including other enhancements and fixes.
The issues you have found earlier (filed as CELLSJAVA-41630) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi,
int count = worksSheets.getCount();FileInputStream fileInputStream = new FileInputStream(“testFile.xlsx”);
Workbook workbook = new Workbook(fileInputStream);WorksheetCollection worksSheets = workbook.getWorksheets();
for(int i =0; i < count; i++) {
Worksheet ws = worksSheets.get(i);
Cells cells = ws.getCells();
int rowCount = cells.getMaxDataRow();
int colCount = cells.getMaxDataColumn();
for(int j = 0; j <= rowCount; j++) {
for(int k = 0; k <= colCount; k++) {
Cell cell = cells.get(j, k);
System.out.println(cell);
}
}
}
Hi,
e.g
Sample code:
FileInputStream fileInputStream = new FileInputStream(“f:\files\testfile.xlsx”);
Workbook workbook = new Workbook(fileInputStream);
WorksheetCollection worksSheets = workbook.getWorksheets();
int count = worksSheets.getCount();
for(int i=0; i < count; i++) {
Worksheet ws = worksSheets.get(i);
Cells cells = ws.getCells();
int rowCount = cells.getMaxDataRow();
int colCount = cells.getMaxDataColumn();
System.out.println("MaxDataRow: " + rowCount);//-1
System.out.println("MaxDataColumn: " + colCount);//-1
System.out.println("A1: " + cells.get(0,0).getStringValue()); //Null
System.out.println("MaxDataColumn: " + colCount);
for(int j = 0; j <= rowCount; j++) {
for(int k = 0; k <= colCount; k++) {
Cell cell = cells.get(j, k);
System.out.println(cell);//Null
System.out.println(cell.getStringValue());//Null
}
}
}
workbook.save(“out1.xlsx”); //The first worksheet is blank in the output file.
Hi,
Thanks for your using Aspose.Cells.
We have fixed the issue logged as CELLSJAVA-41673.
Please download and try the latest fix: Aspose.Cells for Java (Latest Version) and let us know your feedback.
Hi,
Hi,
The issues you have found earlier (filed as CELLSJAVA-41673) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.