@DavidP,
Aspose.Cells has replaced Aspose.Excel which is discontinued and no more under active development. Aspose.Cells provides rich features to work with ranges and merged cells. You can format complete range, convert table to range, access maximum display range, search and replace data in a range, perform calculation on a range of cells, export range of cells to image, work with named ranges and merge/un-merge cells using Aspose.Cells. Following example demonstrates removing named range.
// Instantiate a new Workbook.
Workbook workbook = new Workbook();
// Get all the worksheets in the book.
WorksheetCollection worksheets = workbook.getWorksheets();
// Get the first worksheet in the worksheets collection.
Worksheet worksheet = workbook.getWorksheets().get(0);
// Create a range of cells.
Range range1 = worksheet.getCells().createRange("E12", "I12");
// Name the range.
range1.setName("MyRange");
// Set the outline border to the range.
range1.setOutlineBorder(BorderType.TOP_BORDER, CellBorderType.MEDIUM, Color.fromArgb(0, 0, 128));
range1.setOutlineBorder(BorderType.BOTTOM_BORDER, CellBorderType.MEDIUM, Color.fromArgb(0, 0, 128));
range1.setOutlineBorder(BorderType.LEFT_BORDER, CellBorderType.MEDIUM, Color.fromArgb(0, 0, 128));
range1.setOutlineBorder(BorderType.RIGHT_BORDER, CellBorderType.MEDIUM, Color.fromArgb(0, 0, 128));
// Input some data with some formattings into
// a few cells in the range.
range1.get(0, 0).setValue("Test");
range1.get(0, 4).setValue("123");
// Create another range of cells.
Range range2 = worksheet.getCells().createRange("B3", "F3");
// Name the range.
range2.setName("testrange");
// Copy the first range into second range.
range2.copy(range1);
// Remove the previous named range (range1) with its contents.
worksheet.getCells().clearRange(11, 4, 11, 8);
worksheets.getNames().removeAt(0);
// Save the excel file.
workbook.save(dataDir + "RANRange_out.xls");
// Print message
System.out.println("Process completed successfully");
Following is a list of articles for more information on ranges and merging:
Named Ranges
Merging and Unmerging Cells
Tables and Ranges
Formatting a Range of Cells
Search and Replace Data in a Range
Calculate the sum of a range of cells
Export Range of Cells in a Worksheet to Image
Get the latest free trial version here:
Aspose.Cells for .NET(Latest version)
You can download a ready to run solution here that can be used to test different features of this product without any coding.