Free Support Forum - aspose.com

Problem opening workbook with large amount of data in a cell

Hi,

I am currently evaluating aspose.cell (Java) and running into a problem:

I want to store a large string in a cell, which works, but if I am opening the workbook (calling the function a second time) again I get 'String index out of range: -25534' exception.

This is the samplecode:

public void test() throws Exception {
Workbook workbook = new Workbook();
workbook.open("book1.xls");
Worksheets worksheets = workbook.getWorksheets();
Worksheet sheet = worksheets.getSheet(0);

Cell cell = sheet.getCell("A1") ;
String sTxt = "<" ;
for (int i = 0 ; i < 400; i++)
sTxt += "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 " ;
sTxt += ">";
cell.setValue(sTxt);

workbook.save("book1.xls");

}

Any idea, what's wrong?

regards

Hi,

In Ms Exel , it is forbidden to set a string longer than 32K to cell.

Please try this fix.We add limitation to set a string value to cell.If the string is longer than 32k,a CellsException will be thrown.

Thanks for the prompt response.

Hi,

We are facing the same problem, and we are using .Net, do you have a quick fix for the same?

Aspose.cells version : v1.0.3705

Hi,

Thanks for considering Aspose.

Well, v1.0.3705 is a .NET framework version and not Aspose.Cells version.

Please try the attached version 4.4.0.17. If you still find the problem, please post your sample code with excel file.

Thank you.