Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL: Illegal Operation Error When You Attempt to Format Cells


View products that this article applies to.

This article was previously published under Q285347
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986 (http://support.microsoft.com/kb/256986/EN-US/ ) Description of the Microsoft Windows Registry

↑ Back to the top


Symptoms

When you attempt to format a cell (by using toolbar buttons or menus), you may receive the following error message:
This program has performed an illegal operation and will be shut down. If the problem persists, contact the program vendor.
If you click Details, you receive an error message similar to the following:
EXCEL caused an invalid page fault in module EXCEL.EXE at 015f:3007abc7

↑ Back to the top


Cause

This problem may occur if either of the following registry keys contains a missing or incorrect entry:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Nls\Locale
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Nls\AddLocales
These keys contain all of the locale settings that are under Regional Settings in Control Panel. If one of these keys is missing, your regional settings are blank.

↑ Back to the top


Resolution

To resolve this problem, use either of the following methods to restore the missing or incorrect registry keys.

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

Method 1: Download the Keys from Microsoft

First, download the Locale.reg file from Microsoft. The following file is available for download from the Microsoft Download Center:
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591� How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. After you download the Locale.reg file, follow these steps:
  1. Click Start, and then click Run.
  2. In the Open box, type regedit, and then click OK.
  3. In the left pane of Registry Editor, locate and select the following key (folder) if present:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Nls\Locale
    The next two steps are only necessary if the Locale key is present:
    1. On the Edit menu, click Rename.
    2. Rename the key to OldLocale.
  4. In the left pane of Registry Editor, locate and select the following key (folder) if present:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Nls\AddLocales
    The next two steps are only necessary if the AddLocales key is present:
    1. On the Edit menu, click Rename.
    2. Rename the key to OldAddLocales.
  5. On the Registry menu, click Exit.
  6. Locate and double-click the Locale.reg file that you downloaded earlier.
  7. Click Yes when you are prompted as follows:
    Are you sure you want to add the information in locale.reg to the registry?
  8. Click OK when you are prompted as follows:
    Information in the locale.reg has been successfully entered into the registry.
  9. Restart Windows.
  10. Click Start, point to Settings, and then click Control Panel.
  11. Double-click the Regional Settings icon, and verify that several country choices are listed.

Method 2: Manually Add the Registry Key for an "English (United States)" Locale

Add the Locale Key

  1. Click Start, and then click Run.
  2. In the Open box, type regedit, and then click OK.
  3. In the left pane of Registry Editor, locate and select the following key (folder) if present:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Nls
    Before you proceed to the next step, verify that the Nls key does not contain the Locale key. If the Locale key exists, skip to the "Add the AddLocales Key" section later in this article.
  4. With the NLS key selected, point to New on the Edit menu, and then click Key.
  5. With New Key #1 selected, type Locale and then press ENTER.
  6. With the Locale key selected, double-click the (Default) value in the right pane of Registry Editor.
  7. In the Value data box, type 00000409, and then press ENTER.
  8. On the Edit menu, point to New, and then click String Value.
  9. With New Value #1 selected, type 00000409, and then press ENTER.
  10. In the right pane of Registry Editor, double-click the 00000409 value.
  11. In the Value data box, type English (United States), and then press ENTER.
  12. On the Registry menu, click Exit.
  13. Restart Windows.
  14. Click Start, point to Settings, and then click Control Panel.
  15. Double-click the Regional Settings icon, and verify that your current locale is English (United States).

Add the AddLocales Key

  1. Click Start, and then click Run.
  2. In the Open box, type regedit, and then click OK.
  3. In the left pane of Registry Editor, locate and select the following key (folder) if present:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Nls
    Before you proceed to the next step, verify that the Nls key does not contain the AddLocales key. If the AddLocales key exists, click Exit on the Registry menu and stop here; no further steps are necessary.
  4. On the Edit menu, point to New, and then click Key.
  5. With New Key #1 selected, type AddLocales, and then press ENTER.
  6. With the AddLocales key selected, double-click the (Default) value in the right pane of Registry Editor.
  7. Press ENTER to enter a blank value.
  8. On the Registry menu, click Exit.
  9. Restart Windows.
  10. Click Start, point to Settings, and then click Control Panel.
  11. Double-click the Regional Settings icon, and verify that your current locale is English (United States).

↑ Back to the top


Keywords: KB285347, kbprb, kbgraphxlink, kbfile, kberrmsg, kbdownload, kbdownload

↑ Back to the top

Article Info
Article ID : 285347
Revision : 7
Created on : 1/29/2007
Published on : 1/29/2007
Exists online : False
Views : 389