Single data type

Aug 15, 2011 at 5:00 PM
Edited Aug 15, 2011 at 5:01 PM

Hi everyone, i'm trying to expose a function to excel that takes a parameter of type Single. It doesn't seem to be working... if i change the parameter to double evertyhing works fine... any ideas? I'm guessing i'm missing an imports statement but not sure which one.

 

Thanks, Gonzalo

Coordinator
Aug 15, 2011 at 7:40 PM
Edited Aug 15, 2011 at 7:40 PM

Hi Gonzalo,

Excel-DNA (and the Excel C API) does not support the Single type.

If you can't change your function signature, I'd suggest you just make a wrapper function takes a double, and calls your function.

Is this a problem?

-Govert 

Aug 15, 2011 at 8:15 PM

No, not a problem at all, i can change the signature. Just curious: why doesn't it support Single?

Thanks, Gonzalo

Coordinator
Aug 15, 2011 at 8:22 PM

I started off just implementing the types that are supported by the Excel C API. I've added a few more since - DateTime, Decimal, Int64. But each type I add is a pain because I have to explicitly deal with the type conversion which Excel would otherwise do.

I'll probably have to think through it again some day, and add all the missing standard numeric types like Single. Not that it's a common request...

-Govert