View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Anton Kryukov Anton Kryukov is offline
external usenet poster
 
Posts: 1
Default C Add-In clashes with VBA?

I am trying to write an Add-In XLL in C that calls functions from the
Analysis ToolPack as user-defined functions, for example

Excel(xlUDF, &xRes, 5, TempStr("COUPPCD"),
TempNum(settle), TempNum(maturity), TempNum(freq),
TempNum(basis));

When macros are disabled, things seem to work fine. However if the
spreadsheet contains enabled VBA functions using the Analysis
ToolPack, things go wild. The first invocation of a ToolPack function
from the C Add-In works fine, but the second time the xRes XLOPER has
the xltype field set to xltypeBool instead of xltypeNum, even though
the Exel function itself returns xlretSuccess.
Any ideas about what's happening?
Thanks

Anton Kryukov