Python Forum
xlwings UDF showing name error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
xlwings UDF showing name error
#10
(May-29-2020, 06:31 AM)buran Wrote: maybe I got it wrong... I was under impression you cut part of the traceback in the first psot

No, that was the full error message that appeared on Excel. I'm not sure if it's truncated by Excel though.

I've tested the code further by commenting out xlwings and doing a print as below. It works fine.
#import xlwings as xw
import mibian

#@xw.func
def BSPutOptionImpVol(underlyingPrice,strike,interestRate,expiryDays,premium):
    c = mibian.BS([underlyingPrice, strike, interestRate, expiryDays], putPrice=premium)
 #   return c.impliedVolatility
    print(c.impliedVolatility)
Output:
BSPutOptionImpVol(40.75,32,1,127,0.95) 45.654296875
So, I am a bit stumped why if I were to rewrite it for Excel usage, the Mibian library is not able to use scipy.
Reply


Messages In This Thread
xlwings UDF showing name error - by pwt - May-29-2020, 04:34 AM
RE: xlwings UDF showing name error - by buran - May-29-2020, 04:53 AM
RE: xlwings UDF showing name error - by pwt - May-29-2020, 04:56 AM
RE: xlwings UDF showing name error - by buran - May-29-2020, 05:08 AM
RE: xlwings UDF showing name error - by pwt - May-29-2020, 05:18 AM
RE: xlwings UDF showing name error - by buran - May-29-2020, 06:12 AM
RE: xlwings UDF showing name error - by pwt - May-29-2020, 06:28 AM
RE: xlwings UDF showing name error - by buran - May-29-2020, 06:31 AM
RE: xlwings UDF showing name error - by pwt - May-29-2020, 07:09 AM
RE: xlwings UDF showing name error - by buran - May-29-2020, 06:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  xlwings error when reading a workbook Mishal0488 1 1,255 Aug-01-2023, 02:05 AM
Last Post: deanhystad
  Help using a dynamic array excel formula with XLWings FXMonkey 2 1,428 Jun-06-2023, 09:46 PM
Last Post: FXMonkey
  Showing error Sakeeb 3 27,021 Mar-31-2020, 01:03 PM
Last Post: buran
  No output from xlwings RunPython Macro branches 0 3,087 Oct-29-2017, 04:27 PM
Last Post: branches

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020