How to get Named range data

Oct 29, 2012 at 6:38 PM
Edited Oct 29, 2012 at 6:50 PM

I realize this may not be the right place to post this question but please reply back if have done something like this before.

All I want is to get the ranges (R&C) that name refers to.

Names n = activeWorkbook.Names;

foreach (Name nm in n)
 object[,] data;
 Range range = nm.RefersToRange;
 data = range.Value;


The issue here is data contains only single column, where as in actual it the name refers to 2 columns.

What is the best way to solve this.

Here are references I was looking at but couldnt find a good solution.