I suggest you to trash NPOI and use EPPlus instead. I wasted 3 days to automate some excel creation with NPOI just to discover that to ADD A COLUMN I have to shift every cell manually and manage empty cell on which NPOI returns null objects.
The code you write with EPPlus is 10x smaller and 20x simpler.
NOTE: I'm not affiliated in any way with EPPlus, just my own experience
I suggest you to trash NPOI and use EPPlus instead. I wasted 3 days to automate some excel creation with NPOI just to discover that to ADD A COLUMN I have to shift every cell manually and manage empty cell on which NPOI returns null objects.
In EPPlus it woule be simple as that
worksheet.Cells["columnname"]