excel, add-in, C++, xll, addin, xloper
In the following log file, a typical startup sequence of ANALYSIS32.XLL has been captured with TraceXLL.
The add-in is opening another workbook (FUNCRES.XLA) to retrieve localized functions names and descriptions. => marks functions called by Excel, <= is used to identify callbacks from the add-in.
Found add-in module 'C:\Office10\Makro\Analyse\ANALYS32.XLL'.
=> xlAutoAdd in module C:\Office10\Makro\Analyse\ANALYS32.XLL
=> xlAutoOpen in module C:\Office10\Makro\Analyse\ANALYS32.XLL
<= GetName() = "C:\Office10\Makro\Analyse\ANALYS32.XLL"
<= Free( "C:\Office10\Makro\Analyse\ANALYS32.XLL" ) = {missing}
<= Open( "C:\Office10\Makro\Analyse\FUNCRES.XLA", 0, TRUE ) = TRUE
<= Free( TRUE )
<= GetWorkspace( 37 ) = {XLOPER[1,45] = 49, 49, ".", ",", ... }
<= Index( {XLOPER[1,45] = 49, 49, ".", ",", ... }, 3 ) = "."
<= Free( "." )
<= Index( {XLOPER[1,45] = 49, 49, ".", ",", ... }, 5 ) = ","
<= Free( {XLOPER[1,45] = 49, 49, ".", ",", ... }, "," )
<= GetName() = "C:\Office10\Makro\Analyse\ANALYS32.XLL"
<= Textref( "[FUNCRES.XLA]RES!Func_Table" )
= {Ref: "[FUNCRES.XLA]RES!$D$14:$L$144"}
<= Coerce( {Ref: "[FUNCRES.XLA]RES!$D$14:$L$144"} )
= {XLOPER[131,9] = "hex2dec", "PP#", "HEXINDEZ", "Zahl", ... }
<= Free( {Ref: "[FUNCRES.XLA]RES!$D$14:$L$144"} ) = {missing}
<= Textref( "[FUNCRES.XLA]RES!HelpStrs" )
= {Ref: "[FUNCRES.XLA]RES!$K$14:$U$144"}
<= Coerce( {Ref: "[FUNCRES.XLA]RES!$K$14:$U$144"} )
= {XLOPER[131,11] = "xlmain9.chm!1929",
"Wandelt eine hexadezimale Zahl in eine dezimale Zahl um",
"ist die hexadezimale Zahl, die Sie umwandeln möchten",
{nil}, ... }
<= Free( {Ref: "[FUNCRES.XLA]RES!$K$14:$U$144"} ) = {missing}
After that, it calls "Register" once for every exported function, as shown below for the NOMINAL function.
<= Register(
"C:\Office10\Makro\Analyse\ANALYS32.XLL",
"nominal",
"PPP#",
"NOMINAL",
"Effektiver_Zins,Perioden",
1,
"Finanzmathematik",
{nil},
"xlmain9.chm!1964",
"Liefert die jährliche Nominalverzinsung",
"ist die Effektivverzinsung",
"ist die Anzahl der Zinszahlungen pro Jahr",
{nil},
{nil},
{nil},
{nil},
{nil},
{nil},
{nil}
) = 1000538164
We skip over the dialog and menu registration to the point where the user selects NOMINAL from the Function Wizard and provides actual values:
=> NOMINAL( {missing}, {missing} )
=> NOMINAL( {missing}, {missing} )
=> NOMINAL( 0.035, 4 )
As you can see, the function wizard calls NOMINAL twice with missing parameters, which is quite a surprise for new add-in developers.