×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

creating a pause in a for Loop in Excel VBA

creating a pause in a for Loop in Excel VBA

creating a pause in a for Loop in Excel VBA

(OP)
Hello,

I have written a For loop that uses a shell command to call a batch file that replaces text in a trail file, Mytrail.txt.  I then use that altered text file and use it to run Pro/Engineer by calling it through another shell command.  I would like to add pause instructions to my routine after the shell commands to ensure that each time the text file is changed Pro/Engineer runs the instructions described in the trail file exactly once.  Below is a snippet of the code I am working with:

For i = 1 To N Step 1
Shell ("Reblacer.bat Mytrail.txt string_A string_B)

'Here I would like to add code that will pause the routine 'until the batch file operation is complete.

Shell "C:\Program Files\proeWildfire 3.0\bin\proe.exe Mytrail.txt", vbNormalFocus

'Here I would like to add another pause instruction until 'the above shell command is complete.  Note that this shell 'command creates a new file in some directory whose name is 'actually string_A.prt.  Could this be used to tell visual 'basic that it may recontinue executing the routine.

Next i
End Sub

Does anyone know how to add pauses to the routine above that prompt visual basic to continue executing the code only after the shell commands have completed their tasks?

Regards,
TazEngr
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources