following the examples given in Pyxll.com online doc
I ve written a small function which calculates the number of business days between today and a maturity date:
@xl_func ("datetime Maturity, datetime Holidays : int")
def BD (maturity,holidays):
"""returns number of business days betwen now and maturity,
Holidays = list of holiday dates"""
for i in holidays:
if i.weekday() in (5,6) or (i-t).days<0 or(maturity-i).days<0:
return d-2*d/7 -h
This seems to work fine when called in python ang returns the expected result
when called in XL it s always returning 0
the problem seems to come from the for loop
can it be that daytime as defined in Pyxll is not iterable?
I ve tried some test functions and when I use any iteration or indexing on a datetime variable I get the errors