How to excute python script when pushing a button on excel
I have sev开发者_开发百科eral python scripts, test1,py, test2,py, test3.py and so on.
I would like to have three buttons (using VBA) on the Excel screen.
How do I associate a button to a specific python filename so that I can execute the file and capture the python response into a text box within excel (message response).
You could try embedding Python in Excel with this http://code.google.com/p/pyinex/
Or just have some VBA code that runs a Python shell script and captures the output into a file, then reads the file and fills the textbox.
Or try writing a Python COM server in 20 lines https://web.archive.org/web/20111113152839/http://showmedo.com/videotutorials/series?name=ktn7wmxvn
Or add Python as an Excel scripting language https://web.archive.org/web/20110718231808/http://blog.gobansaor.com/category/microetl/
Once you decide how to connect Excel and Python, the rest is straightforward.
精彩评论