|
-
Jun 30th, 2005, 01:00 PM
#1
Thread Starter
Junior Member
Wait for Shell command to finish in VBA Excell?
I'm using I have an external .exe which I start with the shell command. The .exe in question is just a homebrew form, looks like it could have been written with VB itself. It has a few spaces for data entry and once the proper data has been filled in, you use a dialogue box to select a file and the tool converts the file to a different format. This external application that I'm controlling starts a new MSDOS process to some "conversion" of files. For some reason (at least so far) when I run it through the shell command the MSDOS process dies. I can't see how or why it's failing, but it doesn't do what it's supposed to do. If I run the program manually I can get it to work every time. Any ideas?
I've been trying to try using the WaitForSingleObject API to wait until everything is done and see if that fixes it, but I'm not having much luck. The code I've found online doesn't seem to work with VBA exactly and I haven't been able to figure out how to tweak it.
Also I think the key might be that I need the process ID for the MSDOS task, I have obtained the handle for the window that comes up, but I don't think it's the same and I don't know how to proceed. Any ideas, helpful suggestions?
Thanks,
Matt
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|