asposecells.api

Class NameCollection

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

Property Getters/Setters Summary
methodgetCount()
methodget(index)
Gets the Name element at the specified index.
methodget(text)
Gets the Name element with the specified name.
 
Method Summary
methodadd(value)
Reserved for internal use.
methodadd(text)
Defines a new name.
methodclear()
Remove all defined names which are not referenced by the formulas and data source. If the defined name is refered, we only set Name.ReferTo as null and hide them.
methodcontains(value)
Reserved for internal use.
methodget(index)
Reserved for internal use.
methodindexOf(value)
Reserved for internal use.
methoditerator()
methodremove(text)
Remove the name.
methodremove(names)
Remove an array of name
methodremoveAt(index)
Remove the name at the specific index.
methodremoveDuplicateNames()
Remove the duplicate defined names
methodsort()
Sorts defined names.
 

    • Property Getters/Setters Detail

      • getCount : int 

        int getCount()
        
      • get : Name 

        Name 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 

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

      • add

        int 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.
      • remove

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

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

         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: int - index of the Name to be removed.
      • clear

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

         removeDuplicateNames()
        Remove the duplicate defined names
      • sort

         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

        Iterator iterator()
      • get

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

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

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

        int indexOf(value)
        Reserved for internal use.