Use the WScript.Shell instead, because it has a waitOnReturn option:
waitOnReturn
Dim wsh As Object Set wsh = VBA.CreateObject("WScript.Shell") Dim waitOnReturn As Boolean: waitOnReturn = True Dim windowStyle As Integer: windowStyle = 1 wsh.Run "C:folder unbat.bat", windowStyle, waitOnReturn
(Idea copied from Wait for Shell to finish, then format cells - synchronously execute a command)
2.1m questions
2.1m answers
60 comments
57.0k users