Apose.Cells Fragmented Ranges Not Supported v7.0.4?

Hi guys,

I have an Excel spreadsheet with a fragmented range and can't find it using Worksheets.GetRangeByName or Worksheets.GetNamedRanges.

On a Worksheet called "Config", this is what my range looks like: =Config!$B$13:$C$13;Config!$B$15:$C$16v

Using MS Office Interop 14, I can access this range. The range would be divided into Areas, each Area with a set of coordinates.

Are fragmented ranges not supported or is there another way to access these types of ranges? Any suggestions if it isn't supported?

Thanks,
Steven.

Hi,

Your named range in your template file might be defined Names (NameCollection --> in Name Manager in MS Excel), you may try to use the following sample code to obtain names with its criteria for your requirement:

Sample code:
Workbook book = new Workbook("e:\\test2\\example.xlsx");
WorksheetCollection sheets = book.Worksheets;
NameCollection ranges = sheets.Names;
MessageBox.Show(ranges.Count.ToString());

for(int i =0; i<ranges.Count; i++)
{
MessageBox.Show(ranges[i].Text);
MessageBox.Show(ranges[i].RefersTo);

}

If you still find any issue, give us your template file with sample code, we will check your issue soon.

Thank you.

Thanks Amjad. I noticed another post mentioning this.

This seems to do the trick for us:

Range[] fragRange= Worksheets.Names[nomeRange].GetRanges()

Having gone through this all morning, if you guys could add to your documentation on the GetRangeByName and GetNamedRanges methods to go to Names[].GetRanges, that would help!

Steven.

Hi,

Please use Name.GetRanges() method.

Hi,

" Having gone through this all morning, if you guys could add to your documentation on the GetRangeByName and GetNamedRanges methods to go to Names[].GetRanges, that would help!"

Thanks for your suggestion,

We will soon add/update the relevant topic in the Aspose.Cells for .NET documentation.

Thank you.

Thanks for your help guys. I got it to work pretty easily using Name.GetRanges.

For the documentation, I was thinking if in your Aspose.Cells For .NET Documentation.chm file you could add in WorksheetCollection.GetNamedRanges and WorksheetCollection.GetRangeByName methods to use the Names.GetRanges method for disconected ranges that would help. It's especially difficult to understand why WorksheetCollection.GetNamedRanges will not return disconected ranges (you would assume it returns all ranges in the workbook).

Overall however, awesome product and I'm really impressed with the support.

Steven.

Hi,

Thanks for your comment.

We will keep your feedback in consideration while updating the documentation.