Vincent Tang
Ich habe es herausgefunden.
Ich hatte ein personal.xlsb-Makrobook und thisworkbook.path
verwies auf die falsche Arbeitsmappe.
Am Ende habe ich das getan:
Dim folderPath As String Dim shellCommand As String folderPath = Application.ActiveWorkbook.Path shellCommand = """" & folderPath & "\" & "newcurl.bat" & """" Call Shell(shellCommand, vbNormalFocus)
Leviathan
Sie haben die doppelten Anführungszeichen durcheinander gebracht - ThisWorkbook.path
wird im Befehl wörtlich verwendet.
Sie können es selbst sehen, wenn Sie den Befehl an die Konsole ausgeben:
Dim strCommand As String strCommand = "cmd.exe /k ""cd " & """ & ThisWorkbook.path & """ & " newcurl.bat""" Debug.Print strCommand Shell strCommand