public class NameCollection extends CollectionBase
Name objects in the spreadsheet.| Modifier and Type | Method and Description |
|---|---|
int |
add(java.lang.String text)
Defines a new name.
|
void |
clear()
Remove all defined names which are not referenced by the formulas and data source.
|
Name[] |
filter(int type,
int sheetIndex)
Gets all defined name by scope.
|
Name |
get(int index)
Gets the
Name element at the specified index. |
Name |
get(java.lang.String text)
Gets the
Name element with the specified name. |
void |
remove(java.lang.String text)
Remove the name.
|
void |
remove(java.lang.String[] names)
Remove an array of name
|
void |
removeAt(int index)
Remove the name at the specific index.
|
void |
removeDuplicateNames()
Remove the duplicate defined names
|
void |
sort()
Sorts defined names.
|
public int add(java.lang.String text)
Remarks
Name cannot include spaces and cannot look like cell references.text - The text to use as the name.Name object index.public Name get(int index)
Name element at the specified index.get in class CollectionBaseindex - The zero based index of the element.public Name[] filter(int type, int sheetIndex)
type - NameScopeType. The scope type.sheetIndex - The sheet index.
Only effects when scope type is NameScopeType.WORKSHEETpublic Name get(java.lang.String text)
Name element with the specified name.text - Name text.public void remove(java.lang.String[] names)
names - The names' text.public void remove(java.lang.String text)
text - The name text.public void removeAt(int index)
Remarks
Please make sure that the name is not referred by the other formulas before calling the method. And if the name is referred, setting Name.RefersTo as null is better.removeAt in class CollectionBaseindex - index of the Name to be removed.public void clear()
clear in class CollectionBasepublic void removeDuplicateNames()
public void sort()
Remarks
If you create a large amount of named ranges in the Excel file, please call this method after all named ranges are created and before savingSee Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.