Add Ons - DevSource
DevSource: Microsoft Developer Resource DevSource Home Sponsored by Microsoft Home Add Ons Architecture Languages Techniques Using VS Forums
Home arrow Add Ons arrow Page 3 - The Excel Developer's Friend
The Excel Developer's Friend
By Peter Aitken

Rate This Article: Add This Article To:

The Excel Developer's Friend - ' Beyond Conversion '
( Page 3 of 3 )

When you plan to use TurboExcel, you will find yourself taking a somewhat different approach to workbook design. Because TurboExcel operates at the worksheet level, you should isolate the calculations/algorithms that will be compiled into their own worksheets, separate from other aspects of the workbook. Ideally, each calculation that will be converted into a C++ function should be placed on its own worksheet. You can include more than one function in a DLL if desired.

TurboExcel goes beyond converting worksheet algorithms and provides a limited ability to convert VBA code. This is an important feature because, taken alone, worksheet formulas and functions do not provide the developer with any decision or looping structures, and we all know how important these are to most development tasks. The limitations are rather severe, however. For example, there is no support for global variables or the Object data type. There is partial support for the Application, Range, and Cell objects but not for any other built-in objects.

ADVERTISEMENT

TurboExcel needs a C++ compiler and will use Visual Studio if you have it installed. If not, you can install the free compiler that ships with the product or download the free compiler available from Microsoft.

The Personal Edition of TurboExcel limits you to running generated functions on the computer that was used to generate them, while the Professional Edition provides for unlimited royalty-free distribution. The Professional Edition also lets you view the generated C++ source code and provides some limited debugging capability by sending cell values to a log file at run-time. There is also a Server Edition that provides for deploying the functions on a server and generates thread-safe code. Be prepared for some major sticker shock, with the Personal and Professional editions priced at $999 and $2,999 respectively. A Developer Edition is in the works for $299, allowing unlimited royalty-free distribution and access to source code but limited to workbooks with only a single worksheet.

What about using the C++ source code generated by TurboExcel as a starting point for your own modifications? This is certainly possible if you have the Professional or Developer Edition. While the generated source code is rather cryptic — don't expect any explanatory comments or descriptive variable names — an experienced C++ programmer should not have much trouble with it. Here, for example, is the source code generated by TurboExcel for a function that calculated present value:

tefunc_type double
  presentvalue(double xls2c_SHEET1_B1,double xls2c_SHEET1_B2,
  double xls2c_SHEET1_B7)
{
bool reterror = false;
try {
freeall();
u_na.which = which_error; u_na.uu.e = 42;
SHEET1_B7=xls2c_SHEET1_B7;
SHEET1_B1=xls2c_SHEET1_B1;
SHEET1_B2=xls2c_SHEET1_B2;
try { XLS2CSUBFORMULA1_SHEET1_B9=POWER(tonumber((1. +
 (SHEET1_B7))), tonumber((SHEET1_B2 - (SHEET1_B1))));}
  catch (xl2cerror x)
  { XLS2CSUBFORMULA1_SHEET1_B9 = x;};
try { XLS2CSUBFORMULA0_SHEET1_B9=POWER(tonumber((1. + 
(SHEET1_B7))),
  tonumber((ustruct((SHEET1_B2 - (SHEET1_B1)))/365.25)));}
  catch (xl2cerror x) { XLS2CSUBFORMULA0_SHEET1_B9 = x;};
SHEET1_B9=IF((SHEET1_B2 - (SHEET1_B1)>100.),
  (ustruct(1.)/XLS2CSUBFORMULA0_SHEET1_B9),
  (ustruct(1.)/XLS2CSUBFORMULA1_SHEET1_B9));
xls2cinternal_retval = tonumber(SHEET1_B9);} catch (xl2cerror )
  { reterror = true; } 
//MessageBox(NULL,"title","caption",0);
if (reterror) return 0;
return xls2cinternal_retval;
}

You can visit the company Web site to download a free three day trial or to buy the product with a 30 day money-back guarantee (although there is a 5% "restocking" fee, somewhat puzzling for a product that is delivered via download). I can't help but think that these stiff prices will turn away a lot of developers who could make good use of TurboExcel. It's a highly specialized tool that can bring significant benefits to some development tasks. The Developer Edition is a move in the right direction, and we can only hope that the publisher will continue this move toward making the product more affordable.



 
 
>>> More Add Ons Articles          >>> More By Peter Aitken
 



HD VOIP Has Arrived (with Tony Konstner)

Play Video >

All Videos >

Google and blonde jokes?

Read now >

Favorite books!

Read now >

View Now
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.