SkywardPalm
Board Regular
- Joined
- Oct 23, 2021
- Messages
- 61
- Office Version
- 365
- Platform
- Windows
I am attempting to call a python script from VBA and wait for the script to finish before continuing with the macro. However, It doesn't seem to be calling the python script.. any ideas what I may be doing wrong?
Code I have so far:
Code I have so far:
VBA Code:
Dim objShell As Object
Dim PythonExe, PythonScript As String
Set objShell = VBA.CreateObject("WScript.Shell")
Dim waitOnReturn As Boolean: waitOnReturn = True
Dim windowStyle As Integer: windowStyle = 0
PythonExe = """C:\Python\Python39\python.exe"""
PythonScript = "C:\Users\Me\PycharmProjects\Automation\Matching.py"
objShell.Run "cmd.exe /S /C" & PythonExe & PythonScript, vbHide, windowStyle, waitOnReturn