开发者

How to excute python script when pushing a button on excel

开发者 https://www.devze.com 2023-03-20 00:08 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消