tags:

views:

543

answers:

2

Hi, Please help me through a C# code that In VSTO excel whereever i selected a cell the respective column gets focussed. I need to get the Column value(which column) and row value(which row no) on excel worksheet wherever i focussed.

Please help me to get the same through code.

And also i would like to learn VSTO Excel using C#. Suggest me some good ebooks free downloadable and any web links for the same.

how to get focussed or current cell's column value in VSTO excel using C#

+5  A: 
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.

burnside