Recently (nobody noticed it happening before, if it did) some "ID"-type values are being converted by Excel to dates. There is some logic to which values are being converted, as you can see here, where the user added a column to show what the underlying values really are, and how they should be represented (raw, no conversion):
So because there's a "-" after "01" Excel is thinking that "01-" should be January, an assuming the final two characters represent the year.
In Item codes that contain no dash, they are left alone. How can I prevent Excel from being "helpful" in this way and converting these values to dates?
UPDATE
In response to Scott Craner's comment, this is the code I have to write out that value:
using (var memberItemCodeCell = priceComplianceWorksheet.Cells[rowToPopulate, DETAIL_MEMBERITEMCODE_COL])
{
memberItemCodeCell.Style.Font.Size = DATA_FONT_SIZE;
memberItemCodeCell.Value = _memberItemCode;
memberItemCodeCell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
}
...and when I try to figure out how to format the value as Text or General by typing "for" after the cells name, I see these options:
So what do I need to use - FormatedText (sic) or ConditionalFormatting, and how specifically do I set those up to format the column as Text or General, and which if any of these two are preferred?