Search code examples
javaexceljxl

Accessing beyond 256 columns in excel using JXL


I have an excel file an I need to write beyond 256 columns. The file is in 2007 .xls format. I see that I cannot exceed more than 256 columns.

On the other hand, if I try it with .xlsx format, I see that when I try accessing the excel file, I get a "Unable to recognize OLE Stream error". I read somewhere that this error is because of the excel format compatibility.

This seems to be kind of a chicken egg problem, and can someone help me tackle this?

Thanks Abhishek S


Solution

  • Basically, this has to do with both the Excel file and JXL.

    Excel as .xls (2006 and older) has support only for 256 columns and 65536 lines. (Old limitations documentation)

    These limits are increased in newer versions of Excel (2007 or newer, New limitations doc), that use the .xlsx format, but the new format is exactly that, a new format. There are new functionality as well as new needs and new handling.

    It should be no surprise to you that, unfortunetly, this also means that compatibility with .xls files does not mean compatibility with .xlsx files.

    That's where JXL takes part. Not only it itself must be compatible with the new format (i don't know if it is), but it's likely the implementation is a bit different for each format.

    I am not a JXL user tough (i use Apache POI), so you will have to research and sort out the possible solutions yourself, sorry.