How to get the value of a merged cell using c#
Hi,
Is there a standard way to get the value of a merged cell using c#?
I tried both
1) target.Text
and
2) object[,] arr =
(object[,])target.get_Value(XlRangeValueDataType.xlRangeValu eDefault);
if (null != arr)
ret = Convert.ToString(arr[1, 1]);
If I used method 1), sometimes I got empty string back even though the
value is not an empty string.
If I used method 2), sometimes I got an exception even though the cell
has value.
Any thoughts?
Thanks.
|