Hi, I am stuck here. The code is pretty straightforward.
After I step into the last line I got an errorCode:string str1=null; string str2=null; int rCnt = 0; for (rCnt = 2; rCnt <= nRows; rCnt++) { foreach (KeyValuePair<int, List<int>> pair in dict) { List<int> list = new List<int>(); list = pair.Value; string colName = GetExcelColumnName(list[0]); string col = colName + rCnt .ToString (); str1 = xlWorkSheet1.get_Range(col, misValue).Value2.ToString();But I checked it in the immediate windowCode:Object reference not set to an instance of an object.
It is okay although the value is null but no error.Code:?xlWorkSheet1.get_Range(col, misValue).Value2.ToString()
Thanks for advice.


Reply With Quote