excel4node icon indicating copy to clipboard operation
excel4node copied to clipboard

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

Open SlowburnAZ opened this issue 6 years ago • 11 comments

@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 (https://github.com/amekkawi/excel4node/pull/99) won't apply, but I've tried that anyway with no luck.

Any ideas?

SlowburnAZ avatar Sep 08 '17 15:09 SlowburnAZ

Anyone?

SlowburnAZ avatar Sep 18 '17 13:09 SlowburnAZ

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

SlowburnAZ avatar Oct 04 '17 18:10 SlowburnAZ

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

dangear avatar Oct 24 '17 18:10 dangear

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.

natergj avatar Nov 17 '17 01:11 natergj

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

HardikGlib avatar Apr 11 '18 07:04 HardikGlib

selection_008

HardikGlib avatar Apr 11 '18 07:04 HardikGlib

@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.

natergj avatar Apr 23 '18 23:04 natergj

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

gonet123 avatar May 03 '18 17:05 gonet123

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.

nowherenearithaca avatar Jul 23 '18 18:07 nowherenearithaca

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.

alugowski avatar Sep 27 '18 22:09 alugowski

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.

BruneXX avatar Feb 26 '21 17:02 BruneXX