Free Support Forum - aspose.com

Aspose cells java able to generate only limited no of columns

Hi I am trying to generate a excel having more than 400 columns but when I do that only 255 columns are generated upto IV column


<pre style=“background-color: rgb(255, 255, 255); font-family: “Fira Code”; font-size: 9pt;”>package com.va;
import com.aspose.cells.*;

public class Test {
public static void main(String[] args) throws Exception {
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.getWorksheets().get(0);

for (int i = 0; i < 300; i++) {
Cell cell = worksheet.getCells().get(0, i);
cell.setValue(i);
}
workbook.save("./output/dummy.xls");
}
}
<pre style=“background-color: rgb(255, 255, 255); font-family: “Fira Code”; font-size: 9pt;”>
<pre style=“background-color: rgb(255, 255, 255); font-family: “Fira Code”; font-size: 9pt;”>can you tell me whats the issue?

Hi,


Thanks for sharing the sample code segment.

Well, this is due to the limitation of MS Excel for XLS file format which is an older file format and you can only have/save 65k rows and 256 cols in a worksheet. For your requirements, please use advanced MS Excel (2007-2013/2016) file format, e.g XLSX instead of XLS, you may change the line of code:
i.e.,
workbook.save("./output/dummy.xls");
to:
workbook.save("./output/dummy.xlsx");

Let us know if you still have any issue.

Thank you.