0

I have the below portion of code in an excel 2010 vba. My question is how do I run the java process and wait until it completes before perl process is called?

' CALL JAVA PROGRAM USING SHELL '
Dim wshell As Object

Set wshell = CreateObject("wscript.shell")
wshell.Run Chr(34) & "C:\Users\cmccabe\Desktop\EmArray\Design\java.bat"

' UPDATE PERL VARIABLES '
Dim PerlCommand As String, PerlParameters As String
Dim var As String, var1 As String, var2 As String, var3 As String

var = MyDirectory
var1 = var & "sample_descriptor.txt"
var2 = "C:\cygwin\home\cmccabe\test_probes.txt"
var3 = var & "output.txt"

' CALL PERL '
PerlCommand = """C:\Users\cmccabe\Desktop\EmArray\Design\perl.bat"""
PerlParameters = """" & var & """" & " " & _
"""" & var1 & """" & " " & _
"""" & var2 & """" & " " & _
"""" & var3 & """"
CreateObject("wscript.shell").Run PerlCommand & "  " & PerlParameters

edit: I just saw that post know and it solved my issue... thank you and I apologize, I had a variable named incorrectly :).

Community
  • 1
  • 1
justaguy
  • 2,908
  • 4
  • 17
  • 36
  • Possible duplicate of [Wait for Shell to finish, then format cells](http://stackoverflow.com/questions/8902022/wait-for-shell-to-finish-then-format-cells) – Automate This Dec 03 '15 at 15:59
  • This was not a duplicate but that post I just saw and that solved it. Thank you :). – justaguy Dec 03 '15 at 16:44

0 Answers0