Re: QuantlibXL: multiple calls to qlSetEvaluationDate()

Posted by eric ehlers on
URL: http://quantlib.414.s1.nabble.com/QuantlibXL-multiple-calls-to-qlSetEvaluationDate-tp5043p5045.html

Hello,

On 9/15/06, Wilkie Lai <[hidden email]> wrote:
> Hi Eric and all,
> 1.) I have experienced strange behavior with
> qlSetEvaluationDate().  As I read from the
> documentation there is only one global setting for
> this variable in Excel so I would assume that once a
> call to this function has been made, the evaluation
> date will remain the same unless a different parameter
> is passed to it.

Yes.

> However I have come to notice that
> with multiple calls to this function it actually set
> the global date to another date, seems like a
> hard-coded one: 2005/06/18.  Can anyone share what is
> going on behind the scene?

To my knowledge the only way of setting the evaluation date is with a
call to qlEvaluationDate().  So based on the behavior you describe my
first thought would be that somewhere in your workbook there is
another cell which is passing the value 2005/06/18 to
qlEvaluationDate().

I just noticed that the documentation that shipped with QLA 0.3.13
indicates that the evaluation date can also be reset by function
qlPiecewiseFlatForward().  This was true in 0.3.12 but is no longer
the case in 0.3.13 (in fact that function has been deleted
altogether), I have updated the online documentation
(http://www.quantlibaddin.org/evaluationdate.html).

> 2.) Now because of this change in evaluation date I am
> forced to do global recalculate (Ctrl-Alt-Shift F9,
> usual Ctrl-Alt-F9 don't work) in order to fix the
> date, but after multiple calls (usually 3-4 times)
> then Excel will crash, pointing again to the XLL
> library.  Would this be a  bug or there are other ways
> to change/restate the evaluation date?

Crashing Excel, that needs to be fixed.  If you could email me the
simplest possible example of a spreadsheet which demonstrates the
problem, and steps to recreate the error, I'll try to provide a patch.

Regards,
Eric