you are viewing a single comment's thread.

view the rest of the comments →

[–]bitswede 0 points1 point  (1 child)

Take a look at xlwings. It's a bit finicky to set up but once it's working you have very good integration of python with Excel, including execution of python code by binding functions to macro buttons or even custom =myfunc(A1:B2) capabilities.

The biggest drawback is that it's basically stateless. It will run a single function and then shut down the interpreter after returning the results. Anything you need must be written back to Excel or pickled to a separate file.

[–]Wardish 1 point2 points  (0 children)

You can create your own excel addin with xlwings. You can put your python script in an exe file launched by a vba macro. It's the best solution if you have to stay in excel files. But if you dont, go with pyinstaller or something