calvinXS
calvinXS

Reputation: 123

xlwings - how to import existing UDFs to a new sheet

I can get the basic examples of UDFs working as per the quickstart examples on http://docs.xlwings.org/en/stable/udfs.html#udfs.

What I would like to do next is to import these to another workbook.

I thought that would be as simple as providing the path ('C:\Test\myproject\myproject.py') to the example "myproject.py" python script in the "UDF Modules" section in the xlwings ribbon, but this gives a "ModuleNotFoundError".

ModuleNotFoundError: No module named 'C:\Test\myproject\myproject'

Should this work as expected, or do I need more work to turn the "myproject.py" script into something that is valid as a Module?

Upvotes: 1

Views: 754

Answers (1)

calvinXS
calvinXS

Reputation: 123

The value for PYTHONPATH: should be 'C:\Test\myproject\'

and

The value for UDF modules: is 'myproject'

Upvotes: 1

Related Questions