Can't import UDF from python to Excel using xlwings

Question:

I am using python to write a function and then using xlwings I am trying to import it into Excel but I faced the following error:

enter image description here

My xlwings version is 0.28.5, and python’s is 3.10, and I am using Excel 2013. also both
xlwings32-0.28.5.dll and xlwings64-0.28.5 are in the same folder as the python3.10.exe

enter image description here

the name of the python file and Excel file are the same as instructed by the documentation

I have also tried specifying the python interpreter path in the interpreter box located in the xlwings ribbon in Excel but with no results. I have read the following issues but also with no result:

  1. issue766
  2. issue764

my python function :

enter image description here

finally I have obviously added the xlwings add-in in Excel, and I trust access to the VBA project object model

NOTE: Run Python works just fine with no error.

so, can anyone point to what I am doing wrong or missing?

thanks in advance.

Asked By: Adel Moustafa

||

Answers:

I have solved this by uninstalling the python version that I have and the reinstalling it using anaconda3 distribution. after that from the anaconda prompt type xlwings addin install and every thing worked fine.

Answered By: Adel Moustafa
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.