Delete Named Ranges with Golang via C++
Contents
[
Hide
]
Introduction
If there are too many defined names or named ranges in Excel files, we have to clear some because they are not referenced again.
Remove Named Range in MS Excel
To remove a named range from Excel, you can follow these steps:
- Open Microsoft Excel and open the workbook that contains the named range.
- Go to the Formulas tab in the Excel ribbon.
- Click on the Name Manager button in the Defined Names group. This will open the Name Manager dialog box.
- In the Name Manager dialog box, select the named range you want to remove.
- Click on the Delete button. Confirm the deletion when prompted.
- Click on the Close button to close the Name Manager dialog box.
- Save the workbook to retain the changes.
Delete Named Range using Aspose.Cells for C++
With Aspose.Cells for C++, you can remove named ranges or defined names by text or index in the collection.
Note: If the defined name is referenced by formulas, it cannot be removed. You can only remove the formula that defines the name.
Remove Some Named Ranges
When we remove a defined name, we must check whether it is referenced by any formulas in the file.
To improve performance, we can remove multiple named ranges together.
Remove Duplicate Defined Names
Some Excel files become corrupted because they contain duplicate defined names. Removing these duplicate names can repair the file.