Top  Previous  Next

Deapplies the specified names from the specified scope.

Applies to



result1 = expression1.DeapplyNames

Set result2 = expression2.DeapplyNames(names, scope)

expression1   Required.  An expression that returns an IOAKAddIn object.

expression2   Required.  An expression that returns an IOAKAPI object.

result1 An OAKResult enumeration indicating the success or otherwise of the action.

result2   An object implementing the IDeapplyNamesResult interface whereby any names were not successfully applied may be identified.

names   Required Variant.  The names that are to be deapplied, specified as an array or collection of Excel Name objects.

scope   Optional Variant.  A range, worksheet or workbook in which to deapply the names. The default scope is the whole workspace.


When applied to an IOAKAddIn object, the DeapplyNames method activates the same dialog box as is presented when the Deapply names command is selected manually from the OAK user interface.  The action that follows is controlled by the data gathered by the dialog box from the user.

When applied to an IOAKAPI object, the DeapplyNames method takes opportunities to adjust formulas within the specified  scope so that references to cells by names are replaced to ones by cell reference.  The method returns an IDeapplyNamesResult which may be examined to determine which names were or were not replaced.

The DeapplyNames method accessed through IOAKAPI does not offer the option to ignore constants that is available in through the user interface. It is left to the programmer to determine the correct list of names to deapply.