I'm having trouble finding an answer to this - I'm writing some simple VBA with the goal that my colleagues can install it as an add in or custom tab. Coming from Python I would, of course, prefer to work with xlwings or pyxll, but as I understood it in order to call any python you would have to install xlwings on every computer?
The ideal scenario would be that I could develop excel add ins with xlwings or pyxll and export it as if it were a normal excel add in, so that my colleagues can install it easily. Unfortunately, I can't install all the required python modules on every target computer.
is this possible or just wishful thinking?
4 Answers
One possibility is to convert all the required python files (your scripts, xlwings files and python interpreter) into a standalone executable. The xlwings website gives an example where this has been done (fibonacci_standalone.zip). See also the deployment docs page.
I'm not an expert, but in my experience this is wishful thinking.
First thing first, your colleagues will need Python installed on their computer to run from VBA even with the xlwings add-in. However, if they have python (and any relevant modules that you use like numpy, xlwings, ect.) then you can just give your colleagues a copy of your macro (maybe with the xlwings source code above so they don't need to upload the add-in to VBA).
Again I am not an expert, but I have tried working around this issue and can't find a better solution.
There are various good options for distributing PyXLL based add-ins, including bundling Python and PyXLL into a single installer.
See https://www.pyxll.com/docs/userguide/distribution.html for some details.
Here's a link to what you need to create an MSI for a PyXLL add-in that will include the Python runtime and all of your Python code https://github.com/pyxll/pyxll-installer.
For deploying inside an organization using a startup script is often the best way as it enables you to easily push out updates without having to reinstall anything (https://www.pyxll.com/docs/userguide/distribution.html#using-a-startup-script-to-install-and-update-python-code).
If you need any help with this get in touch with PyXLL support. This is a very common use-case where you want to deploy to non-Python users internally and so they have lots of experience with this.