I do not know if this could have solved your problem, but I encountered the same problem when trying to launch a python script "frozen" with CX-Freeze (from VBA with wsh). Everything worked fine until I changed the folder name of my EXE file to a name with spaces. I did not understand the problem until I read your post and your mention of blank spaces.
I found a function on the internet (maybe here on SO, I don't remember) that gives me the name of the folder in DOS. If like me, you have to pass some parameters that are folder names, then reuse the function to give you the names in DOS.
Here is the function found on internet:
Public Function GetShortFileName(ByVal FullPath As String) As String
'PURPOSE: Returns DOS File Name (8.3 Format) Give
'FullPath for long file name
'PARAMETERS: FullPath: Full Path of Original File
'RETURNS: 8.3 FileName, or "" if FullPath doesn't
' exist or file fails for other reasons
'EXAMPLE:
' GetShortFileName("C:\Nouveau dossier\Nouveau dossier\Nouveau
dossier\Nouveau dossier\Nouveau dossier\")
Dim lAns As Long
Dim sAns As String
Dim iLen As Integer
On Error Resume Next
'this function doesn't work if the file doesn't exist
If Dir(FullPath) = "" Then Exit Function
sAns = Space(255)
lAns = GetShortPathName(FullPath, sAns, 255)
GetShortFileName = Left(sAns, lAns)
End Function
Here is how you could make your sub :
Dim wsh As Object
Set wsh = VBA.CreateObject("WScript.Shell")
Dim waitOnReturn As Boolean: waitOnReturn = True
Dim windowStyle As Integer: windowStyle = 1
Dim program_folder_path
Dim file_path
program_folder_path = "C:\Program Files (x86)\Python27\"
program_folder_path = CStr(GetShortFileName(program_folder_path))
file_path = "C:\Users\Markus\BrowseDirectory.py"
file_path = CStr(GetShortFileName(file_path))
wsh.Run program_folder_path & "python.exe" & file_path, windowStyle,_
waitOnReturn
I hope this could help, sorry for my bad english by the way...
C:\python27.