---
title: "How to access a cell in Excel worksheet using C#"  
description: "How to access a cell in Excel worksheet using C#"  
author: "Anonymous User"  
published: 2013-11-13  
updated: 2013-11-13  
canonical: https://www.mindstick.com/forum/1718/how-to-access-a-cell-in-excel-worksheet-using-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How to access a cell in Excel worksheet using C#

I want to [access](https://www.mindstick.com/articles/12994/how-foreigners-can-access-blocked-websites-in-china) a [cell in Excel](https://answers.mindstick.com/qa/96516/how-can-you-add-comments-to-a-cell-in-excel) worksheet using C#. I tried to use the followed [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii):

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

But its not working.

Any help will be appreciated.

## Replies

### Reply by Anonymous User

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.


---

Original Source: https://www.mindstick.com/forum/1718/how-to-access-a-cell-in-excel-worksheet-using-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
