Whenever you work with an object hierarchy, you should always perform an existence check before attempting to drill down. That way you eliminate issues like what you are encountering here.
For example.
Dim a, b, c As Decimal
For i = 0 to GridItem.Rows.Count
If !IsNothing(GridItem.Rows(i)) And !IsNothing(GridItem.Rows(i).Cells(7) Then
If Decimal.TryParse( GridItem.Rows(i).Cells(7).Value, out a ) Then
c = c + a
End If
End If
txtBasic.Text = c.ToString()