Aspose::Cells::INameCollection Class Referenceabstract

Represents a collection of all the IName objects in the spreadsheet. More...

Inherits CollectionBase.

Public Member Functions

virtual Aspose::Cells::System::Int32 Add (intrusive_ptr< Aspose::Cells::System::String > text)=0
 Defines a new name. More...
 
virtual intrusive_ptr< Aspose::Cells::INameGetObjectByIndex (Aspose::Cells::System::Int32 index)=0
 Gets the IName element at the specified index. More...
 
virtual intrusive_ptr< Aspose::Cells::INameGetObjectByIndex (intrusive_ptr< Aspose::Cells::System::String > text)=0
 Gets the IName element with the specified name. More...
 
virtual void Remove (intrusive_ptr< Aspose::Cells::System::Array1D< Aspose::Cells::System::String *>> names)=0
 Remove an array of name More...
 
virtual void Remove (intrusive_ptr< Aspose::Cells::System::String > text)=0
 Remove the name. More...
 
virtual void RemoveAt (Aspose::Cells::System::Int32 index)=0
 Remove the name at the specific index. More...
 
virtual void Clear ()=0
 Remove all defined names which are not refered by the formulas and data source. If the defined name is refered, we only call SetRefersTo(NULL) of IName, and hide them. More...
 
virtual void RemoveDuplicateNames ()=0
 Remove the duplicate defined names More...
 
virtual void Sort ()=0
 Sorts defined names. More...
 

Detailed Description

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

Member Function Documentation

◆ Add()

virtual Aspose::Cells::System::Int32 Aspose::Cells::INameCollection::Add ( intrusive_ptr< Aspose::Cells::System::String >  text)
pure virtual

Defines a new name.

Parameters
textThe text to use as the name.
Returns
IName object index.

Name cannot include spaces and cannot look like cell references.

◆ Clear()

virtual void Aspose::Cells::INameCollection::Clear ( )
pure virtual

Remove all defined names which are not refered by the formulas and data source. If the defined name is refered, we only call SetRefersTo(NULL) of IName, and hide them.

◆ GetObjectByIndex() [1/2]

virtual intrusive_ptr<Aspose::Cells::IName> Aspose::Cells::INameCollection::GetObjectByIndex ( Aspose::Cells::System::Int32  index)
pure virtual

Gets the IName element at the specified index.

Parameters
indexThe zero based index of the element.
Returns
The element at the specified index.

◆ GetObjectByIndex() [2/2]

virtual intrusive_ptr<Aspose::Cells::IName> Aspose::Cells::INameCollection::GetObjectByIndex ( intrusive_ptr< Aspose::Cells::System::String >  text)
pure virtual

Gets the IName element with the specified name.

Parameters
textName text.
Returns
The element with the specified name.

◆ Remove() [1/2]

virtual void Aspose::Cells::INameCollection::Remove ( intrusive_ptr< Aspose::Cells::System::Array1D< Aspose::Cells::System::String *>>  names)
pure virtual

Remove an array of name

Parameters
namesThe names' text.

◆ Remove() [2/2]

virtual void Aspose::Cells::INameCollection::Remove ( intrusive_ptr< Aspose::Cells::System::String >  text)
pure virtual

Remove the name.

Parameters
textThe name text.

◆ RemoveAt()

virtual void Aspose::Cells::INameCollection::RemoveAt ( Aspose::Cells::System::Int32  index)
pure virtual

Remove the name at the specific index.

Parameters
index

Please make sure that the name is not referred by the other formulas before calling the method. And if the name is referred, please only call SetRefersTo(NULL) of IName.

◆ RemoveDuplicateNames()

virtual void Aspose::Cells::INameCollection::RemoveDuplicateNames ( )
pure virtual

Remove the duplicate defined names

◆ Sort()

virtual void Aspose::Cells::INameCollection::Sort ( )
pure virtual

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