HOW TO ACCESS A CELL IN EXCEL WORKSHEET USING C#

jayprakash sharma

Total Post:117

Points:821
Posted by  jayprakash sharma
C# 
C#
 1040  View(s)
Ratings:
Rate this:

I want to access a cell in Excel worksheet using C#. I tried to use the followed code:

if (xlWorksheet.Cells[k + 5, 0] == Convert.ToString(ent.Cells[i, 3].Value))

{

     p = k;

}

But its not working.

Any help will be appreciated.

  1. ezra heywood

    Post:145

    Points:1019
    Re: How to access a cell in Excel worksheet using C#

    Hi Jay,


    Try the below code:-

    if (xlWorksheet.Cells[k + 5, 0].Text == Convert.ToString(ent.Cells[i, 3].Value   ))

       {

         p = k;

       }

    Hope this will solve your problem.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!