Excel: Macro Error Using UNLOCKED.NEXT() or UNLOCKED.PREV()

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.

REFERENCES

"Microsoft Excel Function Reference," version 4.0, pages 442, 465-466

"Microsoft Excel User's Guide 1," version 4.0, pages 568-570


KBCategory: kb3rdparty
KBSubcategory:


Additional reference words: 5.00 4.00


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 29, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.