Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call a python function from vba

Tags:

python

vba

I am trying to call a python function in a .py file in VBA.

I use this command to open the python shell :

Pathctrl = "C:\users\test\Desktop"
ChDir Pathctrl
Call Shell(Pathctrl & "\anaconda_python.bat ", vbNormalFocus)

I don't know how to write a VBA command to run a specific function within a python shell.

like image 890
Bee Avatar asked Feb 16 '26 00:02

Bee


1 Answers

This is a VBA question (and not related to Python).

According to @Ripster, in Execute a command in command prompt using excel VBA, you can call a Script with Call Shell(...).

like image 122
Laurent LAPORTE Avatar answered Feb 18 '26 15:02

Laurent LAPORTE



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!