I get quite a lot of correspondence around xlls. These are mainly coded in C or C++, and many people are not totally clear on the difference. Language purist are going to hate this, but here goes:
C is like modules in VBA, C++ is like classes.
If all your VBA is in classes (why would you do that in Excel??) then C++ will probably make more sense to you.
If most of your VBA is in modules then plain (or should that be pure?) C will suit you better.
If you have some monster horrible stuff to code, then the OO side of C++ will probably give it the edge, or if you have existing C++ resources you want to expose to Excel, C++ may be better.
But for many VBA devs just wanting moderately simple functions to perform sensibly C is probably the best bet.
Thats a bit of an issue as almost all the frameworks, and tools for writing xlls, are aimed at exposing Excel to C++ devs. None are aimed at helping VBA devs understand this fast xll interface, That what I intend to correct over the next few months.
Excel has an API that is accessible from C (cunningly called the C API), and just about accessible from C++ (If you get it to pretend it is C code).
My advice is the think C when thinking about xlls, that is after all what most of the windows API dlls we use are coded in.
cheers
Simon
Wednesday, 21st May, 2008 at 2:31 am |
You use xlls written in C/C++?? What for? Usually, in quantitative finance anyways, they’re used for building complex mathematical models used for pricing some exotic financial or energy derivative. What are some of the projects you have worked on using xlls?
Wednesday, 21st May, 2008 at 9:22 am |
Looking forward to your posts.
I’m interested in this subject for a long time and I was looking for sample source.
It would be very handy to have a couple of simple functions witch cover the basic handeling of ranges etc….
Jelle-jeroen
Wednesday, 21st May, 2008 at 4:43 pm |
MacroMan, another example I’ve seen is Essbase Enterprise (general ledger) which provided an interface to accounts data via Excel worksheet functions which, I believe, was implemented via an XLL.
Regards –