Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an excel file with more than 256 columns #265

Open
sokmesakhiev opened this issue Apr 1, 2022 · 5 comments
Open

Create an excel file with more than 256 columns #265

sokmesakhiev opened this issue Apr 1, 2022 · 5 comments

Comments

@sokmesakhiev
Copy link

I am having trouble creating an excel file with 355 columns. I opened it via Microsoft excel and there is a message warning me that the file is corrupt but it allowed me to view it. Inside the file, there are only 256 columns created and the other 95 columns are missing.

Screen Shot 2022-04-01 at 1 56 35 PM

Screen Shot 2022-04-01 at 1 56 48 PM

Screen Shot 2022-04-01 at 1 57 06 PM

Screen Shot 2022-04-01 at 1 57 17 PM

@zdavatz
Copy link
Owner

zdavatz commented Apr 1, 2022

  1. Which office version?
  2. Which OS?
  3. Download Libreoffice, open the file with Libreoffice, save the file and try again.
  4. Which software created the original XLS file?

@reviewher
Copy link

XLS file format has a hard limit of 256 columns (A = 0 ... IV = 255) but the library does not enforce the constraint. In light of common row limit errors like https://www.bbc.co.uk/news/technology-54423988 , the best fix is to truncate with warning or error when trying to write beyond the limits.

The file can still be repaired because the col field of the Cell structure is 2 bytes wide. The file can technically support up to XFD (column 65535) but the Excel parser will fail.

@sokmesakhiev
Copy link
Author

  1. Which office version?
  2. Which OS?
  3. Download Libreoffice, open the file with Libreoffice, save the file and try again.
  4. Which software created the original XLS file?

I use Microsoft Office on latest Mac OS.
I don't try with LibreOffice yet but I use gem to create xls file.

@sokmesakhiev
Copy link
Author

XLS file format has a hard limit of 256 columns (A = 0 ... IV = 255) but the library does not enforce the constraint. In light of common row limit errors like https://www.bbc.co.uk/news/technology-54423988 , the best fix is to truncate with warning or error when trying to write beyond the limits.

The file can still be repaired because the col field of the Cell structure is 2 bytes wide. The file can technically support up to XFD (column 65535) but the Excel parser will fail.

Yes, I feel it is the limitation of XLS.

@zdavatz
Copy link
Owner

zdavatz commented Apr 5, 2022

I use Microsoft Office on latest Mac OS. I don't try with LibreOffice yet but I use gem to create xls file.

Please give it a try wit LibreOffice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants