"This Program Has Performed an Illegal Operation" Error Message When You Start Visual Basic Editor (811325)



The information in this article applies to:

  • Microsoft Word 2000
  • Microsoft Excel 2000

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 Description of the Microsoft Windows Registry

SYMPTOMS

When you start Visual Basic Editor in Microsoft Word or in Microsoft Excel, 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.

CAUSE

This behavior may occur if the corresponding registry entry for Microsoft Visual Basic for Applications (VBA) is damaged.

RESOLUTION

To resolve this behavior, delete the following key in the Windows registry:

HKEY_CURRENT_USER\Software\Microsoft\VBA

The registry key is re-created the next time you start Visual Basic Editor. To delete this registry key, follow these steps:

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.
  1. Quit Word or Excel (if it is running).
  2. Export the HKEY_CURRENT_USER\Software\Microsoft\VBA registry key to a .reg file. To do so:
    1. Click Start, and then click Run.
    2. In the Open box, type regedit, and then click OK.
    3. Locate, and then click the following registry key:

      HKEY_CURRENT_USER\Software\Microsoft\VBA

    4. On the File menu, click Export.
    5. Type a name for the .reg file in the File name box, specify a location where you want to save the file (for example, the My Documents folder), and then click Save.
    Note: If you ever have to undo the registry changes that you make in the next step, you can do so by double-clicking this exported .reg file.
  3. Delete the HKEY_CURRENT_USER\Software\Microsoft\VBA registry key. To do so:
    1. Right-click the HKEY_CURRENT_USER\Software\Microsoft\VBA key that you located in step 2c, and then click Delete.
    2. Click Yes when you are prompted to confirm the deletion.
  4. Quit Registry Editor.

MORE INFORMATION

To start Visual Basic Editor in a Microsoft Office 2000 program, follow these steps:
  1. Start the Office 2000 program.
  2. Do one of the following:
    • On the Tools menu, point to Macro, and then click Visual Basic Editor

      -or-
    • Press ALT+F11.

Modification Type:MinorLast Reviewed:1/9/2006
Keywords:KB811325