Closed prickelpit96 closed 3 years ago
Just a guess, but try &
Thanks for the input, but as expected didn't this change anything.Excel works different than Html. The & is not just a special char but a char for formulars.
Excel files are just XML, so if that's going direct to the file it should be correct. I have not worked with this library in a while so can't remember how it handles special characters in this case. You need the ' so maybe '
before the &
. Again I am just guessing, I think I would still be wrong as special characters should be handled already.
I tried the single quote ', wrapped everything in double quotes (with and without single quote), built a formula with =CHAR(38), etc. Nothing helped. At the moment I simply replace '&' by 'and', what is a dirty workaround....
HttpUtility.HtmlEncode() will do the job for you on everything you want to write.
Many thanks for the reply! Works like a charme.
Opened a new issue to fix it.
Fixed in 6b9e78d4733b362ccfbfe12e42b88b85a36e7a3c.
I need to write a text that contains a & to excel and it fails due to the fact that a & is a special char in excel and therefore interpreted in a special way. After writing excel opens with an error and has wiped out the whole text. I tried to fix this by using a single leading ' to format the whole text as 'text' but without success.
Can you help me?