Back to Devexpress

Workbook.DefinedNameConflictResolving Event

officefileapi-devexpress-dot-spreadsheet-dot-workbook-a7836407.md

latest4.7 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Document.Processor

Declaration

csharp
public event DefinedNameConflictResolvingEventHandler DefinedNameConflictResolving
vb
Public Event DefinedNameConflictResolving As DefinedNameConflictResolvingEventHandler

Event Data

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

PropertyDescription
CancelGets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
NameStatusGets the status of the conflict name.
NewNameGets or sets the name for a new version of the defined name being moved or copied.
OldNameGets the defined name for which the event is fired.
UsedNamesProvides access to the set of table and defined names existing in the destination workbook.
UseExistingNameGets or sets a value indicating whether to use the defined name specified on the destination worksheet or workbook in the conflict situation.
ValidatorGets 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.

Implements

DefinedNameConflictResolving

See Also

Workbook Class

Workbook Members

DevExpress.Spreadsheet Namespace