1

Dislaimer: There's a lot of hits when googling my issue. I've spent over a day to review all I could find. Regrettably, those can be placed in two categories. First one corresponds to the interop based solution and the other to the VSTO based one. None of them applies in my case.

I've found this tutorial and this documentation. Still, when applying those (in different variations), the green rectangle in my cells keep appearing.

It's not my decision to use EPPlus but it's my responsibility to make the green thing to go away.

How can I do that and how should I google future issues with that library (it seems like I'm doing something wrong)...

I've tried stuff like this (amongst many others, of course).

var worksheet = package.Workbook.Worksheets.Add("Something");
var validation = worksheet.DataValidations.AddListValidation("a1:aa99");
validation.ShowErrorMessage = false;
Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
  • This `Application.ErrorCheckingOptions.BackgroundChecking = false;` works when using `Interop`, but not for `epplus`... – Trevor May 31 '19 at 13:58
  • Possible duplicate of [Using EPPlus Excel - How to ignore excel error checking or remove green tag on top left of the cell](https://stackoverflow.com/questions/11858109/using-epplus-excel-how-to-ignore-excel-error-checking-or-remove-green-tag-on-t), this may be of help. – Trevor May 31 '19 at 14:01
  • Looks like you want this - [EPPlus - LoadFromCollection - Text converted to number](https://stackoverflow.com/questions/32587834/epplus-loadfromcollection-text-converted-to-number) and you can do it without the need to sub-class the library. – Ernie S May 31 '19 at 22:58
  • @Çöđěxěŕ I've been trying to convert back and fort to string as the answers suggest. I'm not getting the result I'd like, though. The long answer there is not even for EPP - I'm referring to the last one in your link. – Konrad Viltersten Jun 03 '19 at 10:59
  • If you are talking about the green triangle "number stored as text", then you have to make sure that the source data is of datatype integer and not a string. – VDWWD Jun 03 '19 at 16:55
  • @VDWWD Yeah, thanks. I got it working, finally. My "numbers" were sent as strings **and** had a space to separate chunks of three like so: *23 456 234" but the "smart" Excel tried to help me. Thank you MS for that. I ended up converting to an integer (aligning your suggestion) and then assigning the number format to put in the spaces. Those stupid triangles should be opt in not opt out, in my opinion. – Konrad Viltersten Jun 03 '19 at 22:25
  • Answer here: https://stackoverflow.com/a/41349783/492 – CAD bloke Jul 28 '22 at 00:28

0 Answers0