XL: Error Setting Macro Description or Selecting Options

ID: Q136312

5.00 5.00c 7.00 WINDOWS kbusage

The information in this article applies to:

SYMPTOMS

You may receive unexpected behavior when you perform certain actions in the Object Browser dialog box.

   If you are using Microsoft Excel Windows 95
   -------------------------------------------

   The following error message may occur when you click Options:

      This program has performed an illegal operation and will be shut
      down. If the problem persists, contact the program vendor.

   When you close the dialog box, Microsoft Excel will be shut down.

   If you are using Microsoft Excel version 5.0 or 5.0c
   ----------------------------------------------------

   When you enter a description in the Macro Options dialog box and click
   OK, you may receive the following error message:

      An error has occurred in your application. If you choose Ignore, you
      should save you work in a new file. If you choose Close, your
      application will terminate.

CAUSE

This problem occurs when you attempt to set the macro options for a subroutine that takes a user-defined data type as an argument. Specifically, in Microsoft Excel version 7.0, this problem occurs when you display the Object Browser, select the macro, and click Options. In Microsoft Excel version 5.0, this problem occurs when you display the Object Browser, select the macro, click Options, enter a description, and click OK.

WORKAROUND

To work around this problem, remove the user-defined data type argument from the procedure and enter the description for the subroutine.

Example

For example, if you press F2 to display the Object Browser and attempt to set the macro options for subroutine "b" in the example below, one of the error messages described above will be displayed.

Private Type MyDefinedType i As Integer s As String End Type

Sub b(My As MyDefinedType)
End Sub

To work around this problem, remove the argument for subroutine b, as in the following example:

   Sub b()
   End Sub

After the argument is removed, use the object browser to set the description. Once that is completed, you can change the definition of the subroutine back to include the user-defined data type argument, as in the following example:

   Sub b(My as MyDefinedType)

KBCategory: kbusage KBSubcategory: xlwin

Additional reference words: 7.00 5.00 5.00c hang crash gp fault general protection page gpf custom

Keywords          : xlwin 
Version           : 5.00 5.00c 7.00
Platform          : WINDOWS

Last Reviewed: September 16, 1996