How to get current or focused cell value?

c#, excel, vsto

Solution

Excel.Range rng = (Excel.Range) this.Application.ActiveCell;

//get the cell value
object cellValue = rng.Value;

//get the row and column details
int row = rng.Row;
int column = rng.Column;

and here's a quick start walkthrough.

Problem

When I select a cell, the respective column it gets focused. For I need to get the Column value and Row value (row #) on excel worksheet wherever focus changes. How can I do the same through code? How do I get the focused or current cell's column value in VSTO excel using C#?

Original source