babun1
Structural
- Jun 30, 2010
- 6
I was trying to execute python code from excel macro. But error is displayed as "Run-time error '70': Permission denied.". Code is simple as below.
Sub RunPython2()
Dim objShell As Object
Dim PythonExe, PythonScript As String
Set objShell = VBA.CreateObject("Wscript.Shell")
PythonExe = """C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3312.0_x64__qbz5n2kfra8p0\python.exe"""
PythonScript = "D:\personal\python_Work\Python_Path\test.py"
objShell.Run PythonExe & PythonScript
End Sub
Need help to resolve the issue.
Sub RunPython2()
Dim objShell As Object
Dim PythonExe, PythonScript As String
Set objShell = VBA.CreateObject("Wscript.Shell")
PythonExe = """C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3312.0_x64__qbz5n2kfra8p0\python.exe"""
PythonScript = "D:\personal\python_Work\Python_Path\test.py"
objShell.Run PythonExe & PythonScript
End Sub
Need help to resolve the issue.