Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel add-ins in Python

Is there any way I can make Excel add-ins/extensions using Python?

I have tried javascript but haven't found any result about making add-ins on python.

like image 981
Atit Bimali Avatar asked Nov 28 '25 04:11

Atit Bimali


1 Answers

You could try xlOil (disclaimer: I wrote it). The docs are here. To write a simple three input function, you would install xlOil using:

pip install xloil
xloil install

Then write:

import xloil

@xloil.func
def myfunc(x, y, z):
    return x + y * z

Put this code either:

  1. In a py file in the same directory as your spreadsheet, named Book1.py (if your sheet is called Book1.xlsx)
  2. In a py file on your python module path, then edit %APPDATA%\xlOil\xlOil.ini to load it as described in the docs.

Start Excel, open your spreadsheet and the function will be available as myfunc.

like image 169
stevecu Avatar answered Nov 29 '25 18:11

stevecu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!