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

Export failed due to error "The Excel limit is 32767 characters per cell" #647

Open
DanStevens opened this issue Jun 24, 2024 · 7 comments

Comments

@DanStevens
Copy link

I tried to perform an export of all resource strings in a solution I'm using as I'd like to search them. When I did so I received the following error:

The Excel limit is 32767 characters per cell. This text can't be exported: {"EngineerName":null,"EngineerOrganization":null,"...

I understand this means one of the resource values in the solution has a length that exceeds one of Excel's limits. Unfortunately, this causes the entire export to fail - the result is an invalid Excel file that doesn't contain any data. While we can't fix Excels limitations, it would be better if the extension handled this error more gracefully, for example by truncating long values to the 32767 characters.

An additional option to resolve this would be to add support for CSV export, which being a raw data format isn't affected by Excel's limitations. Also, Excel does seem able to handle opening of CSV files with very long fields by truncating them.

Attached below is a Visual Studio project with a very long resource string that can be used to reproduce this bug:

LongResourceString.zip

@DanStevens
Copy link
Author

I thought I'd try selecting all cells and copy-pasting them into Excel, but the Copy button is disabled. Is there a limit to the number of entries that can be copied? The solution I'm working on has just over 10,000 resource strings.

@tom-englert
Copy link
Collaborator

I think you can change the export format to CSV in the options

@tom-englert
Copy link
Collaborator

Also be aware when text gets truncated during export, the truncated text will later be imprted

@tom-englert
Copy link
Collaborator

And there should be no limit on copying

@tom-englert
Copy link
Collaborator

https://github.com/dotnet/ResXResourceManager/blob/master/src%2FResXManager.Model%2FExcelExtensions.cs#L296-L299

Maybe here we could just export an empty cell, instead of throwing

@tom-englert
Copy link
Collaborator

@tom-englert
Copy link
Collaborator

@DanStevens any input on this?

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

No branches or pull requests

2 participants