RedefineName

This page in 2007
Top  Previous  Next

Deletes a specified name, creates a new one, and changes all formulas and names that refer to the old name so that they refer instead to the new one.

Applies to

IOAKAddIn, IOAKAPI

SYNTAX

Set result1 = expression1.RedefineName

Set result2 = expression2.RedefineName(name1,name2,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 IRenameResult which indicates the success or otherwise of the action.

name1        Required Name. The name that is to be changed.

name2        Required String. The new name that is to be used.

scope        Optional. One of

an Excel Workbook object, if OAK is to adjust any formulas which refer to the names being replaced in that workbook.

an Excel Worksheet object, if OAK is to adjust any formulas which refer to the names being replaced in that worksheet.

Nothing, if OAK is to adjust any formulas which refer to the names being replaced in any open workbook.

Remarks

When applied to an IOAKAddIn object, the RedefineName method activates the same dialog box as is presented when the Redefine name 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 RedefineName method changes names as specified by the parameters submitted to the method.