Skip to main content
Row

Workbook.DefinedNameConflictResolving Event

Occurs when the formula or sheet being moved or copied contains a defined name which already exists on the destination worksheet or workbook.

You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use this event in production code.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Docs.v24.1.dll

NuGet Package: DevExpress.Document.Processor

Declaration

public event DefinedNameConflictResolvingEventHandler DefinedNameConflictResolving

Event Data

The DefinedNameConflictResolving event's data class is DefinedNameConflictResolvingEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
NameStatus Gets the status of the conflict name.
NewName Gets or sets the name for a new version of the defined name being moved or copied.
OldName Gets the defined name for which the event is fired.
UsedNames Provides access to the set of table and defined names existing in the destination workbook.
UseExistingName Gets or sets a value indicating whether to use the defined name specified on the destination worksheet or workbook in the conflict situation.
Validator Gets or sets a validator used to check whether a new version of the conflict name is valid and unique.

Remarks

Note that when you’re working with a Workbook, you don’t need to subscribe to the DefinedNameConflictResolving event, since a valid version of the copied name is automatically generated and used by default in the conflict situation. To change this name, handle the DefinedNameConflictResolving event and assign the necessary name to the DefinedNameConflictResolvingEventArgs.NewName parameter.

To use the defined name specified on the destination worksheet or workbook if the conflict occurs during the copy operation, set the DefinedNameConflictResolvingEventArgs.UseExistingName parameter to true.

The DefinedNameConflictResolvingEventArgs.Validator parameter provides access to the default validator that enables you to validate a new version of the conflict name before pasting it into the destination worksheet/workbook. You can also specify a custom validator by creating an object implementing the IDefinedNameValidator interface and assigning it to the DefinedNameConflictResolvingEventArgs.Validator property.

See Also