# Excel crashes

[Q] Excel crashes when executing programs using XLPack or using worksheet functions (suddenly terminates, automation error occurs, etc.).

[A] Typical causes are:

**(1) Excel crashes when accidentally calling a VBA function from a worksheet instead of a worksheet function**

Please refer to FAQ "A worksheet function does not work".

**(2) VBA program crashes due to invalid definition of user-defined external routine**

Numerical integration, ordinary differential equations, nonlinear equations, etc. require user-defined external routines, and the number and type of arguments, return value type (in the case of functions), etc. must be defined exactly as described in the manual. The address of a user-defined routine is passed to XLPack using the Addressof operator, but the arguments are not checked for validity by VBA. Since the external routine at the passed address makes calls as if it were defined correctly, Excel may crash or give wrong answers if the definition is incorrect. You should either write your external routines carefully or use the reverse communication version instead to avoid this.

**(3) Worksheet function program bug for special functions**

Worksheet functions for special functions of XLPack 6.0.5 or 6.0.6 for 32 bit Excel may crash. Please update XLPack Basic and XLPack Addon to 6.0.10 or later. Please refer to the following FAQs for how to update.