XL: Custom Function Returns Incorrect Value/Appears to Hang

ID: Q125723

The information in this article applies to:

SYMPTOMS

In Microsoft Excel, when you use a custom function, the function may return an incorrectly calculated value, or, during recalculation, the function may appear to hang your computer (to return control to your Microsoft Excel, press the ESC key).

CAUSE

This problem occurs under the following conditions:

WORKAROUND

To ensure that Microsoft Excel calculates the custom function properly, add the expected data types for all arguments when you declare the function. For the example, change the function

   Function Test (arg)

to:

   Function Test (arg As Integer)

STATUS

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

Additional query words: 5.00 5.00a 5.00c 7.00 7.00a XL98 XL97 XL7 XL5

Keywords          : kbprg kbdta PgmOthr KbVBA 
Version           : WINDOWS:5.0,5.0c,7.0,7.0a,97; MACINTOSH:5.0,98
Platform          : MACINTOSH WINDOWS
Issue type        : kbprb

Last Reviewed: May 19, 1999