Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Sub RunPythonScript()
- 'Declare Variables
- Dim objShell As Object
- Dim PythonExe, PythonScript, cmd As String
- 'Create a new Object shell.
- Set objShell = VBA.CreateObject("Wscript.Shell")
- 'Provide file path to Python.exe
- 'USE TRIPLE QUOTES WHEN FILE PATH CONTAINS SPACES.
- PythonExe = """C:\Users\gobro7\AppData\Local\Programs\Python\Python39\python.exe """
- PythonScript = """C:\Users\gobro7\Digital Wholesale - Documents\2. Amazon\Customer Operations_OTC\02. Amazon weekly Report\Amazon weekly automation (Giorgi)\VL.py"""
- cmd = PythonExe & PythonScript
- Debug.Print cmd
- 'Run the Python Script
- objShell.run cmd, 0, True
- MsgBox "Finished"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement