سؤال

I have a problem in that using the following code

var num = sheet.Cells[row, col].Value;

or

var num = sheet.Cells[row, col].Value2;

will not return a value if the cell contains only a number. Am I missing something silly here? I also ought to mention that I am doing this with a csv file and office 2010.

Thanks all.

هل كانت مفيدة؟

المحلول

var num is declared as what? number or string? Try FormulaR1C1 to get the value. Works sometimes. :)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top