Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

Created Unassigned: Date value as text in excel file [9444]

$
0
0
I am trying to set a text value to one of my columns.
Text value is 2015/06/03 15:15

Below is the code, that I use to set this column

excelWorkSheet.Cell(j + 1, k).SetDataType(XLCellValues.Text);
excelWorkSheet.Cell(j + 1, k)
.Style.NumberFormat.SetNumberFormatId(0);
excelWorkSheet.Cell(j + 1, k).Value = cellValue;

This is converting my string as a number.

How could I show this value as a text(Not as date time or a number)

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>