Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Excel files generated by excel4node always showing a warning/error upon opening #140

Open
SlowburnAZ opened this issue Sep 8, 2017 · 11 comments
Assignees

Comments

@SlowburnAZ
Copy link

SlowburnAZ commented Sep 8, 2017

@amekkawi
Every Excel file that I generate shows a warning/error when opening:

image

Excel version from Office 2016.

My Excel files do not not have any images, so I'm guessing that the fix proposed in pull request 99 (#99) won't apply, but I've tried that anyway with no luck.

Any ideas?

@SlowburnAZ
Copy link
Author

Anyone?

@SlowburnAZ
Copy link
Author

So, it appears that this problem will occur if your sheet name is longer than 31 characters.

@dangear
Copy link

dangear commented Oct 24, 2017

I had a same problem.
You need to create new Workbook every time when you generate new file:
var wb = new xl.Workbook();

@natergj natergj self-assigned this Nov 17, 2017
@natergj
Copy link
Owner

natergj commented Nov 17, 2017

It looks like the 31 character limit is a hard coded limitation into MS Excel. There is nothing that I can find in the XLSX spec about this limitation, however. I'll see about adding some validation and possibly providing a warning/error when attempting to create a worksheet with a name longer than 31 characters.

@HardikGlib
Copy link

Sheet Name is less than 31 character, still not opening file in MS Office 2016.
And Generating same Error

@HardikGlib
Copy link

selection_008

@natergj
Copy link
Owner

natergj commented Apr 23, 2018

@HardikGlib, can you provide a gist that demonstrates the issue? That "we found a problem" prompt can occur for many reasons and you may be seeing that for some reason other than the sheet name character length.

@gonet123
Copy link

gonet123 commented May 3, 2018

I had the same problem.
I don't have images and the name of the sheets are less than 31.
I thought it could be the file name but it was not.

It did work when I removed special characters ( _ , : é à -) from the sheet name

I hope it can help you

@nowherenearithaca
Copy link

nowherenearithaca commented Jul 23, 2018

Other things that I've seen cause this are

  • cells with more than 200-ish characters (excel says it can take ~32k characters, so maybe it's a mac thing)

  • malformed links

Might be worth spitting out some warnings when this happens, if specified limits can be trusted.

Also including warnings about (possibly) invalid sheetnames would probably be useful.

@alugowski
Copy link

So, it appears that this problem will occur if your sheet name is longer than 31 characters.

This one hit us, because it's not on Microsoft's list of Excel limits: https://support.office.com/en-us/article/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3

There are many limits that Excel enforces but other readers like LibreOffice, Numbers, GSheets, don't. It might be worthwhile for excel4node to check for at least the easy ones.

The character limits, worksheet name length, etc., can be checked for easily. I imagine the link count limit can also be checked for easily. Simple checks would make the export faster.

Also like others have experienced, Excel will only say "there is a problem". Also since the free readers don't have these limits some developers will find it hard to reproduce bugs.

@BruneXX
Copy link

BruneXX commented Feb 26, 2021

Hi guys, I'm seeing that the posts are really old... So is this repo still maintained? What about this? I'm having troubles to open generated sheets in MS Excel, but in LibreOffice are opening just fine.

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

No branches or pull requests

8 participants