6

I want to create a user defined function written in Python. Then I want to compile it to a dll, and distribute it and call in EXCEL vba on another computer which doesn't have python installed.

For example, I want to create a function in Python:

def add(a,b): return a+b

Then, compile it and export it as a dll. On another computer without Python, I can to import this function in EXCEL vba and use it. How to do it?

Thanks,

user2662434
  • 109
  • 1
  • 1
  • 2
  • See [Is it possible to compile a program written in Python?](http://stackoverflow.com/questions/1957054/is-it-possible-to-compile-a-program-written-in-python) – Comintern Aug 09 '16 at 14:34

1 Answers1

4

in excel go to the vbe editor Tools>References browse your dll and add a reference, this will make available your dll functions in vba.

as per making it a dll, look what jb suggest here How to compile a Python package to a dll and follow the comments on that as well.

another option would be like stated here https://code.google.com/archive/p/shedskin/

Community
  • 1
  • 1
Sol Stein
  • 656
  • 10
  • 29