XL: Error Setting Macro Description or Selecting Options

Last reviewed: September 13, 1996
Article ID: Q136312
The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows 95, version 7.0

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



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: September 13, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.