CSV file strips off leading 0 when reading in Excel.
Posted on 2007-03-19
I have an Excel spreadsheet that I save as a CSV file. There is one value that I save with a zero padding in the beginning of the field. When I load up the CSV file in Excel it strips off the leading 0. But if I look at it in notepad it is there. The problem I have is that when I try to read it in Excel Automation (using c#) it very much acts as it does when opening the file in Excel, i.e., stripping off the leading 0. The field is a key to a database table and will not work without the leading 0. Is there a way in Excel or preferrably C# to read the true value?