Microsoft KB Archive/87300

{| = Excel: Macro Error Using UNLOCKED.NEXT or UNLOCKED.PREV =
 * width="100%"|

Last reviewed: November 29, 1994

Article ID: Q87300 The information in this article applies to:


 * Microsoft Excel for Windows, version 4.0

SUMMARY
In version 4.0 of Microsoft Excel for Windows, with the Alternate Navigation Keys option selected, a macro that calls UNLOCKED.NEXT or UNLOCKED.PREV returns a macro error. The same macro runs without error in version 3.0 of Excel.

You can prevent the macro error by disabling Alternate Navigation Keys.

MORE INFORMATION
The Alternate Navigation Keys option provides an alternate set of keyboard actions for moving, selecting and entering data in Excel. In version 4.0 of Excel, the TAB and SHIFT+TAB key functions, under the Alternate Navigation Keys option, were changed to help make the transition from Lotus 1-2-3 easier. The macro error results from these changes.

In versions 2.0, 3.0 and 4.0 of Excel, UNLOCKED.NEXT and UNLOCKED.PREV are equivalent to pressing TAB or SHIFT+TAB on a protected worksheet. In version 4.0 of Excel, the Alternate Navigation Keys option maps TAB to PAGE RIGHT and SHIFT+TAB to PAGE LEFT.

To see if the Alternate Navigation Keys option is selected, choose Workspace from the Options menu.

To disable Alternate Navigation Keys:


 * 1) From the Options menu, choose Workspace.
 * 2) On the Workspace dialog box, clear the Alternate Navigation Keys check box.

To temporarily disable Alternate Navigation Keys in your macro:
 * 1) Call WORKSPACE with the Alternate Navigation Keys argument set to FALSE prior to calling either UNLOCKED.NEXT or UNLOCKED.PREV.
 * 2) Call WORKSPACE with the Alternate Navigation Keys argument set to TRUE after calling either UNLOCKED.NEXT or UNLOCKED.PREV.

For example: A1: =WORKSPACE(,,,,,,,,,,,,FALSE) A2: =UNLOCKED.NEXT A3: =WORKSPACE(,,,,,,,,,,,,TRUE) A3: =RETURN

Note: The Alternate Navigation Keys option is the thirteenth argument to WORKSPACE. The 12 commas must be entered as place holders for the previous arguments for Excel to interpret the function correctly.