XLL+ Class Library

SafeCode Sample

Overview

This add-in makes use of structured exception handling, to stop Excel from crashing when unsafe code causes hardware errors such Integer Divide By Zero and Access Violation.

Any add-in that uses code from another source, which is potentially unsafe or is re-released frequently can benefit from this sort of protection.

For a fuller explanation of the technique used, see C Structured Exception handling in the XLL+ User Guide.

Functions used

CXlOper::FromDoubleArray
CXlOper::Format
CXlOper::Ret
CXlOper::RetError

Project files

If you are using MS Developer Studio 6, then you should open the project file SafeCode.dsp.

If you are using MS Visual Studio .NET 2002, then you should open the solution file SafeCode.sln or the project file SafeCode.vcproj.

If you are using MS Visual Studio .NET 2003, then you should open the solution file SafeCode71.sln or the project file SafeCode71.vcproj.

If you are using MS Visual Studio 2005, then you should open the solution file SafeCode8.sln or the project file SafeCode8.vcproj.

See Also

List of Sample Projects | Samples and Walkthroughs | C Structured Exception handling