how to determine that a Cell of Excel contains nothing?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cyhcyhhychyc
    New Member
    • Dec 2009
    • 8

    how to determine that a Cell of Excel contains nothing?

    I've tryed using syntax below:
    Convert.IsDBNul l(xSheet.Cells[i, 2])

    and
    Excel.Range ran = (Excel.Range)xS heet.Cells[i, 2];
    if (ran.Value2 == null)

    All the trys end up with an exception msg:"HRESULT:0x 800A03EC".
    dont know why.
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Try just getting the data from the cell and stick it in a string.
    If it is an empty string, or if you get a 'null reference exception' while getting the data, it stands to reason it is null.

    Comment

    Working...