Reputation: 359
I'm facing a problem after extracting data from my sqlServer dataBase to my Excel worksheet using Microsoft.Office.Interop.Excel reference. Numeric data are displayed in a scientific numeric format, instead of being displayed in a text format. I tried to format my cell this way, but still doesn't work :
Microsoft.Office.Interop.Excel.Range cell= (Range) worksheet.Cells[rowNum, fieldNum];
cell.NumberFormat="@";
I tried even to set my cells format in my Input Excel file; which i'm actually using as a template for this program; as Number or Text but helplessly it's not working.
How can i fix please this problem ?
Upvotes: 0
Views: 1785
Reputation: 1127
try by using EntireColumn
cell.EntireColumn.NumberFormat = "@";
Upvotes: 1