Hi, I am stuck here. The code is pretty straightforward.
Code:
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();
After I step into the last line I got an error
Code:
Object reference not set to an instance of an object.
But I checked it in the immediate window
Code:
?xlWorkSheet1.get_Range(col, misValue).Value2.ToString()
It is okay although the value is null but no error.
Thanks for advice.