officefileapi-devexpress-dot-spreadsheet-dot-definednamecollection.md
Removes all defined names from the collection.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
void Clear()
Sub Clear
Note that calling the Clear method also disposes all elements removed from the collection.
To remove an individual defined name from the collection, use the DefinedNameCollection.Remove or DefinedNameCollection.RemoveAt methods.
Note
After you delete a defined name, all cells using that name will display the #NAME? error. After you delete a named cell or cell range, all cells using defined names that refer to the deleted cell or cell range will display the #REF! error.
To add a new defined name to the collection, use the DefinedNameCollection.Add method.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Clear() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
Sheet["I6:I8"].ClearContents();
workbook.DefinedNames.Clear();
}
See Also