I\'m writing numbers to an Excel spreadsheet from a DataTable
and all of these numbers are 5 digits long with preceding 0s if the number itself is less than 5 digit
This answer just solved a major problem with a solution from one of our company's software, I had to retrieve the value as displayed, but once I set it to the new sheet, it was being inserted as a number. Simple solution. I cant vote up as yet, but down follows how it ended up.
for (int h = 1; h <= 1; h++)
{
int col = lastColl(sheets);
for (int r = 1; r <= src.Count; r++)
{
sheets.Cells[r, col + 1] = "'"+src.Cells[r, h].Text.ToString().Trim();
}
}