The easiest method is to use the "pyxll activate" command.
Move (or copy) the PyXLL add-in (pyxll.xll file), along with the pyxll.cfg file, ribbon.xml file (if using) and all other Python files required.
Then, call the "pyxll activate" command with the new path of the pyxll.xll file:
>> pyxll activate "c:\path\to\your\pyxll.xll"
or
>> python.exe -m pyxll activate "c:\path\to\your\pyxll.xll"See https://www.pyxll.com/docs/userguide/installation/cli.html#pyxll-activate for details of this command.
The "pyxll activate" command will update Excel's settings so that the referenced pyxll.xll is loaded when Excel starts, and will remove pyxll.xll file that was registered previously.
You can have multiple copies of versions of PyXLL on your computer at once and use "pyxll activate" to easily switch between them.
Excel must be closed before running the "pyxll activate" command.
If you prefer to not use the "pyxll activate" command and instead want to move it manually,
To relocate or move the location of your pyxll.xll file without using the "pyxll activate" command, you will need to first un-install the PyXLL add-in from Excel, move the PyXLL files, and then re-install the PyXLL add-in in Excel.
- Uninstall the PyXLL add-in.
In Excel go to Options -> Add-Ins -> Manage Excel Add-Ins. Unselect the PyXLL add-in, and completely close all running instances of Excel.
Important: Check there are no other open Excel sessions as Excel has the strange behavior that it remembers the add-ins from the last open Excel instance. If you have another Excel instance running with PyXLL loaded, and you close that after removing PyXLL from another instance, Excel will still remember it which can be very confusing! If in doubt, close all Excel sessions, open one new one, remove the add-in, and then close that session.
- Move the PyXLL add-in files.
When moving, ensure all files including the config file (pyxll.cfg) are moved. Your Python modules and other files can be referenced using a relative path in your config file, and so if you are doing that you will need to move your Python files too, or change your config.
- Re-Install the PyXLL add-in.
Start Excel again (since in 1. you completely closed Excel). The PyXLL add-in should no longer be loaded now when you start Excel.
Install the moved pyxll.xll add-in from the new location via Options -> Add-Ins -> Manage Excel Add-Ins.
Tip: If you are ever unsure about where Excel is loading PyXLL from, go to Add-Ins -> PyXLL -> About. For older versions of PyXLL that don't show this information in the about screen, go to Options -> Add-Ins and you will be able to see the path of the add-in there.