John Adcock - 2012-01-27

With XLW there are 2 main modes of operation, handwritten or auto-generated.

It would seem you are using the auto-generated approach. In version 4 the automatic layer adds some memory management and checks for being called in function wizard which are quite slow.

For high performance with XLW 4 use the handwritten mode, With your example it would be possible to get identical performance.

If you want to start using eth XlfOper structures then there is a memory management function whose performance has been improved in version 5.

Also in version 5 it is possible to disable the function wizard check by adding the //<xlw:fast tag above the function definition.