XL: Error Setting Macro Description or Selecting OptionsLast reviewed: September 13, 1996Article ID: Q136312 |
The information in this article applies to:
SYMPTOMSYou 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. CAUSEThis 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.
WORKAROUNDTo work around this problem, remove the user-defined data type argument from the procedure and enter the description for the subroutine.
ExampleFor 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 SubTo work around this problem, remove the argument for subroutine b, as in the following example:
Sub b() End SubAfter 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |