Handling handles

My friend Deane Yang pointed out returning invalid handles as 0 is not the Excel thing to do. Those get propagated down the line to dependent functions which then keep reporting errors. The right way to do it is to return std::numeric_limits::quiet_NaN() instead. That shows up as #NUM! in Excel and dependent calculations never get called.

I’ve added a class called xll::handlex that is a replacement for HANDLEX and sets the default handle value to a NaN.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s