Run Python Code with Excel VBA |

Published: 21 September 2021
on channel: Brandon Jacobson (Jacobson Enterprises)
15,083
139

In this video, I'll show you how to run a python code using Excel VBA.

The VBA code below is not mine. I found it in dozens and dozens of google searches and it's the same code. Remember to change the two variables inside the """ """"

#Python #ExcelVBA

Follow me on Twitter and Github @bjone6.

====================================
Sub RunPythonScript()

Dim objShell As Object
Dim PythonExePath As String, PythonScriptPath As String
ActiveWorkbook.Save
ChDir ActiveWorkbook.Path

Set objShell = VBA.CreateObject("Wscript.Shell")

PythonExePath = """ """
PythonScriptPath = """ """

objShell.Run PythonExePath & PythonScriptPath

End Sub


On this page of the site you can watch the video online Run Python Code with Excel VBA | with a duration of hours minute second in good quality, which was uploaded by the user Brandon Jacobson (Jacobson Enterprises) 21 September 2021, share the link with friends and acquaintances, this video has already been watched 15,083 times on youtube and it was liked by 139 viewers. Enjoy your viewing!