In Excel I have a button that when I click it shell's out to a .exe file someone else made. I used the API function ShellExecute because I wanted to specify parameters.

I want to wait until the .exe file is done running until I continue on with my code. So I have been trying to use OpenProcess and GetExitCodeProcess API functions. The problem is whenever I try to get the .exe file's process handle it comes back as 0. I am not sure what the problem is. Any ideas would be greatly appreciated.

Thanks!