aspose.cells

Class NameCollection

Represents a collection of all the Name objects in the spreadsheet.

Property Getters/Setters Summary
functiongetCount()
functionget(index)
Gets the Name element at the specified index.
functionget(text)
Gets the Name element with the specified name.
 
Method Summary
functionadd(value)
Reserved for internal use.
functionadd(text)
Defines a new name.
functionclear()
Remove all defined names which are not referenced by the formulas and data source. If the defined name is referred, we only set Name.ReferTo as null and hide them.
functioncontains(value)
Reserved for internal use.
functionfilter(type, sheetIndex)
Gets all defined name by scope.
functionget(index)
Reserved for internal use.
functionindexOf(value)
Reserved for internal use.
functioniterator()
functionremove(text)
Remove the name.
functionremove(names)
Remove an array of name
functionremoveAt(index)
Remove the name at the specific index.
functionremoveDuplicateNames()
Remove the duplicate defined names
functionsort()
Sorts defined names.
 

    • Property Getters/Setters Detail

      • getCount : Number 

        function getCount()
        
      • get : Name 

        function get(index)
        
        Gets the Name element at the specified index.
        Parameters:
        index - The zero based index of the element.
        Returns:
        The element at the specified index.
      • get : Name 

        function get(text)
        
        Gets the Name element with the specified name.
        Parameters:
        text - Name text.
        Returns:
        The element with the specified name.
    • Method Detail

      • add

        function add(text)
        Defines a new name. Name cannot include spaces and cannot look like cell references.
        Parameters:
        text: String - The text to use as the name.
        Returns:
        Name object index.
      • filter

        function filter(type, sheetIndex)
        Gets all defined name by scope.
        Parameters:
        type: Number - A NameScopeType value. The scope type.
        sheetIndex: Number - The sheet index. Only effects when scope type is NameScopeType.WORKSHEET
        Returns:
      • remove

        function remove(names)
        Remove an array of name
        Parameters:
        names: String[] - The names' text.
      • remove

        function remove(text)
        Remove the name.
        Parameters:
        text: String - The name text.
      • removeAt

        function removeAt(index)
        Remove the name at the specific index. 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.
        Parameters:
        index: Number - index of the Name to be removed.
      • clear

        function clear()
        Remove all defined names which are not referenced by the formulas and data source. If the defined name is referred, we only set Name.ReferTo as null and hide them.
      • removeDuplicateNames

        function removeDuplicateNames()
        Remove the duplicate defined names
      • sort

        function sort()
        Sorts defined names. 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 saving
      • iterator

        function iterator()
      • get

        function get(index)
        Reserved for internal use.
      • contains

        function contains(value)
        Reserved for internal use.
      • add

        function add(value)
        Reserved for internal use.
      • indexOf

        function indexOf(value)
        Reserved for internal use.