how to read merged cells?

Hi

How to read the content of merged cells, using C#

thx

Yuelin



Answer this question

how to read merged cells?

  • mwong7025

    Hi Yuelin,

    Here's some sample code from our support engineer:

    We can easily access the data from merged cell like a normal cell.

    If A1 and B1 are merged, we can access the data from Cells[1, 1].

    ====

    Excel.Worksheet ws;

    ws = (Excel.Worksheet)thisWorkbook.Worksheets[1];

    Excel.Range cf;

    cf = (Excel.Range)ws.Cells[1,1];

    MessageBox.Show((string)cf.Text);

    ====

    -brenda (ISV Buddy Team)



  • how to read merged cells?