XL: GP Fault/Hang Using Range of Cells in Function Procedure

Last reviewed: September 13, 1996
Article ID: Q121324
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

In Microsoft Excel, if you use a range of cells in a Visual Basic function procedure, you receive a general protection (GP) fault, or your system may hang.

CAUSE

This problem occurs if you use a function procedure to return a range of cells on a worksheet as an array, and the range of cells contains a volatile function, such as the RAND() function. For example, this problem occurs if you use the function Test() on a worksheet, where Test is the following function:

   Function Test(x)
      Test = x
   End Function

Your system stops responding if one of the cells that you use in the function contains a volatile function. If more than one of the cells contains a volatile function, you receive a GP fault.

Note that this is not a problem if you use a single cell in a function procedure, and the cell contains a volatile function.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

REFERENCES

For more information about the Function Statement, choose the Search button in the Visual Basic Reference and type:

   function procedures


KBCategory: kbprg
KBSubcategory:

Additional reference words: 5.00 5.00c 7.00 gpf



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.