Click here to Skip to main content
15,915,734 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
There are files:
C:\tmp\01.mcr
C:\tmp\02.mcr
....
C:\tmp\99.mcr
My code is:
Dim i as interger, nStr as string
for i=1 to 99
nStr=right(str(100+i),2) & ".mcr"
Shell("C:\MacroRecorder\MacroRecorderLite.exe " & nStr, "AppWinStyle.MinimizedFocus, True, -1)
next

When I set value TRUE in Shell Function then MacroRecorder can't click to a button in my form.

When I set value FALSE in Shell Function then value i is running to 99.

How can to run MacroRecorder with my form (activing) step by step in FOR...NEXT.
Posted

1 solution

The Shell command is really the wrong one to use for this as it will either launch the other program without waiting for it to finish or will only run the other program when the calling program has finished, this is based on the true/false wait value.

A better option would be to use the System.Diagnostics.Process.Start command, there is an article here[^] on how to use it, this is a multi-page article with the second page showing how to monitor the launched application.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900