I'm using EPPlus in my C# code to create an Excel workbook. My code includes this statement:
ws.Cells[1, 1].Formula = "=UNICHAR(160)";
But when I execute my code and open the Excel workbook that it generates, cell A1 displays the error #NAME? The Excel error message states, "The formula contains unrecognized text."
The reason for the error is that cell A1 doesn't contain the formula that I entered. It actually contains the formula =@UNICHAR(160). Excel has inserted an extraneous @ as the second character of the formula, thereby corrupting it.
Why is Excel converting my valid formula =UNICHAR(160) into an invalid formula =@UNICHAR(160), and how can I make it stop corrupting what I've written?