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

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Juan Pablo González

MrExcel MVP
Joined
Feb 8, 2002
Messages
11,959
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.
 

Forum statistics

Threads
1,144,360
Messages
5,723,902
Members
422,525
Latest member
dsenff

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
Top