Output to Excel [Sheet] and Style Template limitations

Just an observation, maybe for the help file?

If you exceed 31 characters for the [Sheet] name as part of the Excel filename in Output to File, and do not use a Style template, then it will work, but the [Sheet] name will be truncated to 31 characters:
MyFileName.xlsx[123456789012345678901234567890123] will have the worksheet name
[1234567890123456789012345678901].

If you exceed 31 characters for the [Sheet] name as part of the Excel filename, and do use the Style template, then it will not work (“Unable to copy styling… Unable to read sheet…”). You need to have 31 characters or less.
So if you use file name variables to create the [Sheet] name, be careful the output does not exceed 31 characters (as I have spent a bit of time finding out!)

I think there was in past a limitation to 31 characters in Excel. As far as I understood all Excel imports and exports are done with som libraries. These might still use the older rules.

https://answers.microsoft.com/en-us/msoffice/forum/all/is-it-possible-to-increase-the-maximum-number-of/ebf2b43a-e5cb-4837-b0df-07e409f9e9db

Edit: I tried it, in my Excel in GUI I’m limited to 31 characters, too. So it is Excel and not EDT.

Yes - 31 characters is the limit in Excel.
But with no EDT style template, over 31 is truncated to 31 from EDT to Excel.
But with EDT style template, over 31 produces (“Unable to copy styling… Unable to read sheet…”).

Thanks. I will make a note to look into it.

I believe that 31 character limit for sheet names is still valid for recent versions of Excel.

The rules for naming Excel sheets are quite strange:

Worksheet names cannot:

Be blank.

Contain more than 31 characters.

Contain any of the following characters: / \ ? * : [ ]

For example, 02/17/2016 would not be a valid worksheet name, but 02-17-2016 would work fine.

Begin or end with an apostrophe ('), but they can be used in between text or numbers in a name.

Be named "History". This is a reserved word Excel uses internally.

@MarsKy
I have added a warning if the sheet name is invalid due to:

  • empty
  • >31 characters
  • starts or ends with apostrophe
  • reserved name

I will also add something to the documentation.

Thanks for bringing this to our attention.

1 Like

There are now more warnings about invalid sheet names in v2.7.0, including sheet names > 31 characters.