I am trying to set the cell data type, but it seems impossible to do with EPPlus.
If I put a number as a value in a cell, I get the general data type in the exported Excel file.
If NumberFormat cells are given, for example:
workSheet.Cells[range].Style.Numberformat.Format = "mm/dd/yyyy hh:mm:ss";
Then I still will not get the date or time. The exported Excel file displays the cells as custom data types.
I can only get generic or user data types. I want to set the Cells data type to Time, but I cannot. The problem is that if the data type is not defined, then for some reason the pivot table on another sheet sorts the numbers as strings: (
So, is there a way to set the data type in a cell, please?
source share