I used the Chr $ method (34), for example:
Sub RunPython() Dim scriptName As String Dim stAppName As String scriptName = ActiveWorkbook.Path & "\aprPlotter.py" stAppName = "python.exe " & Chr$(34) & scriptName & Chr$(34) Debug.Print stAppName Call Shell(stAppName, vbHide) End Sub
I used the same path for python script as an Excel workbook to make it easier for users. I went crazy with quotes in 45 minutes before I found this topic. When paths exit active jobs (especially with spaces in Windows), I think this is the preferred method. Hope this helps someone else.
Timwaters
source share