---
Product: Aspose.Cells
Platform: cpp
Page Type: reference
Canonical URL: https://reference.aspose.org/cells/cpp/definednamecollection
---

# DefinedNameCollection

## Overview

`DefinedNameCollection` is a class in Aspose.Cells FOSS for C++.

Represents a collection of defined name objects.

This class declares 5 methods for DefinedNameCollection objects in C++ programs.
Available methods include: `Add`, `GetCount`, `GetEnumerator`, `RemoveAt`.
Public members are accessible to any C++ application after installing the Aspose.Cells FOSS for C++ package.

## Methods

| Signature | Description |
|-----------|-------------|
| `GetCount()` → `int` | Gets the number of items. |
| `Add(name: std::string_view, formula: std::string_view)` → `int` | Adds the specified item. The name. The formula. The zero-based index of the added item. |
| `Add(name: std::string_view, formula: std::string_view, localSheetIndex: std::optional<int>)` → `int` | Adds the specified item. The name. The formula. The local sheet index. The zero-based index of the added item. |
| `RemoveAt(index: int)` | Removes the specified item. The zero-based index. |
| `GetEnumerator()` → `std::vector<DefinedName>` | Returns a snapshot of all defined names in the collection. A vector containing copies of all defined names. |

## See Also

- [Aspose.Cells — Enterprise API Reference](https://reference.aspose.com/cells/)