-1

When I generate an Excel spreadsheet from C#, the account number column lost its leading zeros in the spreadsheet.

For example, if any row has the account number '00012345678', then when I generate the spreadsheet, it shows like '12345678'.

Please help me.

I try to put \t,\n,',etc. but no luck.

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Vimal Vataliya
  • 260
  • 4
  • 15

1 Answers1

1

Excel is seeing the value as a number, which will drop the leading zero's. You will need to add the number as "Text", possibly specifying the data type or supplying the values with "quotes".

Mark Redman
  • 24,079
  • 20
  • 92
  • 147