XL5: GP Fault Running Macro That Passes Argument to SubLast reviewed: September 12, 1996Article ID: Q120043 |
The information in this article applies to:
SYMPTOMSIn Microsoft Excel, you receive a general protection (GP) fault when you run a Visual Basic procedure that passes an argument to another sub procedure, if the sub procedure closes the workbook that containsthe calling procedure.
CAUSEFor example, this problem occurs if you use the following syntax to call the sub procedure "Update" with the argument "1":
Application.Run "Update(1)"-or-
Application.Run("Update(1)")If the procedure Update in the above example closes the workbook that contains the Application.Run command (the calling procedure), you receive a GP fault. The problem occurs whether the procedures are stored in the same workbook, or different workbooks.
WORKAROUNDTo avoid receiving a GP fault when you call a sub procedure with an argument, when the sub procedure closes the workbook that contains the calling procedure, use the following syntax to call the sub procedure:
Application.Run "Update", 1 STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel version 7.0. Note that in Microsoft Excel version 5.0c, if you use the syntax that causes the problem described above, you do not receive a GP fault, however, the sub procedure may not run as expected. For additional information, please see the following article(s) in the Microsoft Knowledge Base:
ARTICLE-ID: Q118881 TITLE : XL5: Unexpected Results Calling Sub Procedure with Arguments |
KBCategory: kbprg
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |