Launch batch file, pause VBA code until done...

strorg

Board Regular
Joined
Mar 27, 2002
Messages
112
I would like to launch an executable file (via command prompt), wait for the file to complete it's task, and then resume execution of my VBA routine. Does anybody have an example of how I might do this. I am familiar with the Shell function, but am struggling a bit. I've searched the forum but haven't been able to quite piece it together. Help greatly appreciated.

Regards...Tom

ps How do I close the command prompt window from VBA?
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Do a search for "ShellAndWait+VBA" without the quotes on Google. You should get a method from Stephen Bullen as number 1 answer.

About your PS I imagine you have to use the SendMessage API function, but I'm not too familiar with it.
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,267
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top