QuantLibXL function in Excel, limit in number of arguments?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

QuantLibXL function in Excel, limit in number of arguments?

willshaw
Hi,

It seems that the function exposed to Excel by QuantLibXL has a limit in number of arguments, 15. If I have more than 15 arguments in function, although I can compile xll successfully, when I click the function in Excel, nothing happens. But if I reduced the arguments to less than 15 without doing anything else, it works.

Any idea?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: QuantLibXL function in Excel, limit in number of arguments?

Eric Ehlers-2
Hello,

There is a limit of 20 arguments to QuantLibXL functions.  I
have added a new item in the FAQ to document this issue:

http://quantlib.org/quantlibaddin/faq.html#faq_item_numparams

I cannot explain why you are hitting a limit of 15.  How are
you going about adding the additional arguments?  Are you
editing the XML function metadata for gensrc?  Or are you
manually editing the C++ source files that were autogenerated
by gensrc?

Regards,
Eric

On Tue, July 15, 2008 13:59, willshaw wrote:
>
> Hi,
>
> It seems that the function exposed to Excel by QuantLibXL has
a
> limit in
> number of arguments, 15. If I have more than 15 arguments in
> function,
> although I can compile xll successfully, when I click the
> function in Excel,
> nothing happens. But if I reduced the arguments to less than
15
> without
> doing anything else, it works.
>
> Any idea?
>
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/QuantLibXL-function-in-Excel%2C-limit-in-number-of-arguments--tp18464649p18464649.html
Sent from the quantlib-dev mailing list archive at
Nabble.com.
>
>
> -------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move
> Developer's challenge
> Build the coolest Linux based applications with Moblin SDK &
> win great prizes
> Grand prize is a trip for two to an Open Source event
anywhere
> in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> QuantLib-dev mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>


-------------------------
Eric Ehlers
nazcatech sprl | Brussels | http://www.nazcatech.be
Distributed computing for pricing analytics - Use Microsoft
Excel as a client to the Grid





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: QuantLibXL function in Excel, limit in number of arguments?

willshaw
Hi, to expose a function to Excel, I first define the function interface in project "QuantLibObjects" under namespace QuantLibAddin, it should call the real function in QuantLib, then edit the xml in project "qlgensrc", then compile. No edit of autogenerated files. I use Excel 2003.

Regards,


Eric Ehlers-2 wrote
Hello,

There is a limit of 20 arguments to QuantLibXL functions.  I
have added a new item in the FAQ to document this issue:

http://quantlib.org/quantlibaddin/faq.html#faq_item_numparams

I cannot explain why you are hitting a limit of 15.  How are
you going about adding the additional arguments?  Are you
editing the XML function metadata for gensrc?  Or are you
manually editing the C++ source files that were autogenerated
by gensrc?

Regards,
Eric

On Tue, July 15, 2008 13:59, willshaw wrote:
>
> Hi,
>
> It seems that the function exposed to Excel by QuantLibXL has
a
> limit in
> number of arguments, 15. If I have more than 15 arguments in
> function,
> although I can compile xll successfully, when I click the
> function in Excel,
> nothing happens. But if I reduced the arguments to less than
15
> without
> doing anything else, it works.
>
> Any idea?
>
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/QuantLibXL-function-in-Excel%2C-limit-in-number-of-arguments--tp18464649p18464649.html
Sent from the quantlib-dev mailing list archive at
Nabble.com.
>
>
> -------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move
> Developer's challenge
> Build the coolest Linux based applications with Moblin SDK &
> win great prizes
> Grand prize is a trip for two to an Open Source event
anywhere
> in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> QuantLib-dev mailing list
> QuantLib-dev@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>


-------------------------
Eric Ehlers
nazcatech sprl | Brussels | http://www.nazcatech.be
Distributed computing for pricing analytics - Use Microsoft
Excel as a client to the Grid





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
QuantLib-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: QuantLibXL function in Excel, limit in number of arguments?

Eric Ehlers-2
Hello,

On Wed, July 23, 2008 02:14, willshaw wrote:
>
> Hi, to expose a function to Excel, I first define the
function
> interface in
> project "QuantLibObjects" under namespace QuantLibAddin, it
> should call the
> real function in QuantLib, then edit the xml in project
> "qlgensrc", then
> compile. No edit of autogenerated files. I use Excel 2003.

Very strange.  Please send me the smallest possible patch which
would allow me to recreate the problem - e.g. a handful of
files containing your edits which I could unzip onto a clean
install of 0.9.0.

Thanks,
Eric

-------------------------
Eric Ehlers
nazcatech sprl | Brussels | http://www.nazcatech.be
Distributed computing for pricing analytics - Use Microsoft
Excel as a client to the Grid


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: QuantLibXL function in Excel, limit in number of arguments?

willshaw
Hi, Eric,

I just double check again. I defined own function with 15 arguments. But with extra 3 arguments, namely Permanent, Trigger, and Overwrite, there are actually 18 in Excel.
But this does not matter really because I assume you will upgrade QuantLibXL to take advantage of Excel 2007.

May I ask another question? What serializationIncludes and addinIncludes mean in XML files?

Thanks.

 
Eric Ehlers-2 wrote
Hello,

On Wed, July 23, 2008 02:14, willshaw wrote:
>
> Hi, to expose a function to Excel, I first define the
function
> interface in
> project "QuantLibObjects" under namespace QuantLibAddin, it
> should call the
> real function in QuantLib, then edit the xml in project
> "qlgensrc", then
> compile. No edit of autogenerated files. I use Excel 2003.

Very strange.  Please send me the smallest possible patch which
would allow me to recreate the problem - e.g. a handful of
files containing your edits which I could unzip onto a clean
install of 0.9.0.

Thanks,
Eric

-------------------------
Eric Ehlers
nazcatech sprl | Brussels | http://www.nazcatech.be
Distributed computing for pricing analytics - Use Microsoft
Excel as a client to the Grid


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
QuantLib-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: QuantLibXL function in Excel, limit in number of arguments?

Eric Ehlers-2
Hello,

On Wed, August 6, 2008 03:09, willshaw wrote:
>
> Hi, Eric,
>
> I just double check again. I defined own function with 15
> arguments. But
> with extra 3 arguments, namely Permanent, Trigger, and
> Overwrite, there are
> actually 18 in Excel.

That's a very good point.  Certain parameters are generated
automatically:
- 4 for a Constructor - ObjectId, Permanent, Trigger, Overwrite
- 2 for a Member - ObjectId, Trigger
- 1 for a Utility - Trigger
These need to be taken into account when ensuring that the
total number of parameters does not exceed the limit of 20.

I just did a quick test, adding dummy parameters to a
constructor function to get a total of 20 parameters (16 user
defined + 4 autogenerated).  I tested the function in Excel and
it looks OK - it displays correctly in the Function Wizard and
seems to function as expected.  Are you saying that a similar
test still fails for you?  If so I again invite you to send me
your modifications so that I can recreate the problem on my
machine.

I mentioned in an earlier email that it's possible to define
user functions with up to 30 parameters, with the limitation
that the Function Wizard displays descriptions for only the
first 20.  I thought QuantLibXL did not support this trick but
I have just noticed that there is in fact an attempt to
implement this feature, but it is broken.  I'll try to resolve
this when I can, for now I would advise sticking to the 20
parameter limit.

> But this does not matter really because I assume you will
> upgrade QuantLibXL
> to take advantage of Excel 2007.

I certainly intend to but I don't need the upgrade myself right
now so it's not on my immediate todo list.

> May I ask another question? What serializationIncludes and
> addinIncludes
> mean in XML files?

serializationIncludes specifies the #include directives for
files autogenerated to QuantLibAddin\qlo\Serialization.
addinIncludes specifies the #include directives for files
autogenerated to QuantLibXL\qlxl\Functions.
The two values are usually the same.

Regards,
Eric

-------------------------
Eric Ehlers
nazcatech sprl | Brussels | http://www.nazcatech.be
Distributed computing for pricing analytics - Use Microsoft
Excel as a client to the Grid


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: QuantLibXL function in Excel, limit in number of arguments?

willshaw
Hi, Eric,

I just reinstalled my Excel 2003 this weekend. Now it works fine with 20 arguments. Thanks.

BTW. My previous constructor function has 14 own-defined arguments,  another is ObjectID. So plus
Permanent, Trigger, Overwrite is 18. Just to clarify.

Now it's all ok with 20 arguments.


Eric Ehlers-2 wrote
Hello,

On Wed, August 6, 2008 03:09, willshaw wrote:
>
> Hi, Eric,
>
> I just double check again. I defined own function with 15
> arguments. But
> with extra 3 arguments, namely Permanent, Trigger, and
> Overwrite, there are
> actually 18 in Excel.

That's a very good point.  Certain parameters are generated
automatically:
- 4 for a Constructor - ObjectId, Permanent, Trigger, Overwrite
- 2 for a Member - ObjectId, Trigger
- 1 for a Utility - Trigger
These need to be taken into account when ensuring that the
total number of parameters does not exceed the limit of 20.

I just did a quick test, adding dummy parameters to a
constructor function to get a total of 20 parameters (16 user
defined + 4 autogenerated).  I tested the function in Excel and
it looks OK - it displays correctly in the Function Wizard and
seems to function as expected.  Are you saying that a similar
test still fails for you?  If so I again invite you to send me
your modifications so that I can recreate the problem on my
machine.

I mentioned in an earlier email that it's possible to define
user functions with up to 30 parameters, with the limitation
that the Function Wizard displays descriptions for only the
first 20.  I thought QuantLibXL did not support this trick but
I have just noticed that there is in fact an attempt to
implement this feature, but it is broken.  I'll try to resolve
this when I can, for now I would advise sticking to the 20
parameter limit.

> But this does not matter really because I assume you will
> upgrade QuantLibXL
> to take advantage of Excel 2007.

I certainly intend to but I don't need the upgrade myself right
now so it's not on my immediate todo list.

> May I ask another question? What serializationIncludes and
> addinIncludes
> mean in XML files?

serializationIncludes specifies the #include directives for
files autogenerated to QuantLibAddin\qlo\Serialization.
addinIncludes specifies the #include directives for files
autogenerated to QuantLibXL\qlxl\Functions.
The two values are usually the same.

Regards,
Eric

-------------------------
Eric Ehlers
nazcatech sprl | Brussels | http://www.nazcatech.be
Distributed computing for pricing analytics - Use Microsoft
Excel as a client to the Grid


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
QuantLib-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-dev