Vivek
Vivek

Reputation: 81

xlwings : Object Required

I'm a newbie into both python and xlwings. So the story is,

I need a custom function needs to be used in Excel. Since I have no clue about VB scripts, I decided to write a function in python and import it in excel using xlwings.

I wrote my function in the python

import xlwings as xl
@xl.func
def exponent(x,y):
#the function is an example only. I tried this for practicing and it is also not working
    z=x**y
    return z

Instead of getting a result, I'm getting "Object Required" I don't know what went wrong?

Any ideas what I'm missing? Forgive me for the basic question.

Upvotes: 8

Views: 9287

Answers (1)

ajaali
ajaali

Reputation: 920

You need to add the Reference in VBA.
Open up the Developer console (Alt-F11) Click on Tools -> References and select xlwings

Upvotes: 21

Related Questions