I am new to xlwings and I want to use py file as a calculation engine for multiple excel workbooks.
So I want to put py file in a fixed folder such as C:\pycal\mycalculation.py and use different excel files to link to this py file. my problem is: in excel, how to import and run python in a different folder; and how to pass the path of the excel to python. in python, how to receive the path of the calling excel?
You'd have to add the according folder C:\pycal
as your PYTHONPATH
in the xlwings settings. This is mentioned as a Note on the Quickstart guide as well as documented under Settings.