This simply means that you are trying to use a property of an object which is actually a NULL.
Now, looking at the line you say:
DataGridView1.Rows[iIndex].Cells.Value = iGLCount.ToString();
Potential objects, which can be easily debugged, seen and rectified are:
: Is this object NULL? If so, doing a ToString() would throw an error
: Does this return a valid row object? If yes, move ahead for third and last one
: Does this return a proper object? If not, and is a NULL, then doing a .Value would throw an error.
Now, just check which one of it is (1 or 2 or 3) and handle the same. Have a NULL check before using it.