Buttons icon indicating copy to clipboard operation
Buttons copied to clipboard

218 Character Excel File Name Length Limit

Open mgersten opened this issue 3 years ago • 4 comments

Feature Request

Per Microsoft's documentation, newer versions of Excel have a 218 character file name length limit including the file path.

218 characters - This includes the file path. For example, C:\Username\Documents\FileName.xlsx.

https://support.microsoft.com/en-us/office/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3

It would be nice if the HTML5 Excel export limited file names to something that is in line with this limitation.

Thanks!

mgersten avatar Jul 21 '22 23:07 mgersten

Wow - I'm genuinely gobsmacked. That is really short when including the full path. I don't even understand why the path and file name length would be dictated by the software rather than the OS.

I can certainly add a 218 character length limit to the file name. We don't know where the file will be saved so we can't include the path.

AllanJard avatar Jul 22 '22 07:07 AllanJard

Thanks for the quick response. It indeed seems unusual. I was thinking that a default limit between 150 and 175 characters would allow for a normal file path to a user's downloads directory.

v2 of this could include a setter so that integrators of Buttons can override to their own preference.

Thanks!

mgersten avatar Jul 22 '22 13:07 mgersten

I've applied a 175 character limit and it does an automatic truncation rather than throwing up an error.

I'm utterly baffled as to why that rule would apply.

AllanJard avatar Jul 26 '22 15:07 AllanJard

Apparently it is due to the Excel file linking having a limit of 255 characters - https://support.microsoft.com/en-us/topic/error-message-when-you-open-or-save-a-file-in-microsoft-excel-filename-is-not-valid-951229f3-dc14-980f-765e-224e4fdc7331 :-/

AllanJard avatar Jul 26 '22 15:07 AllanJard

Forgot to close this

AllanJard avatar Feb 03 '23 11:02 AllanJard