Is it possible to ignore Excel warnings when generating spreadsheets using EPPlus?

前端 未结 4 425
余生分开走
余生分开走 2020-12-06 18:54

I\'m storing mix of numeric and non-numeric values in a single column in spreadsheet using C# and EPPlus. When I open spreadsheet with Excel it shows green triangles in the

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-06 19:05

    You really have 2 options using code:

    • change the .NumberFormat property of Range to TEXT (I believe equivalent in epplus is Cell[row, column].Style.NumberFormat.Format)

    • prefix any number with ' (a single quote) - Excel then treats the number as TEXT - visually, it displays the number as is but the formula will show the single quote.

    Alternatively, which I wouldn't recommend relying on

    • play with Excel's properties and untick the option to display warnings

提交回复
热议问题