By using vba.booksticle.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

948 Steps to 6 Figures by Learning Excel-VBA and Other Skills



Step 759 - ShellAndWait API


Public Sub ShellAndWait(cmdLine As String)

   Dim hProcess As Long
   Dim taskId As Long
  
   taskId = Shell(cmdLine, vbNormalFocus)
  
   hProcess = OpenProcess(SYNCHRONIZE, True, taskId)
   Call WaitForSingleObject(hProcess, WAIT_INFINITE)
   CloseHandle hProcess

End Sub

   Table of Contents | Send us your feedback | © 2025 All Rights Reserved | Edit