等到命令在vba中完成,然后另一个启动

时间:2015-12-03 15:52:56

标签: excel-vba vba excel

我在excel 2010 vba中有以下部分代码。我的问题是如何运行java process并等到调用perl进程之前完成?

' 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

编辑:我刚看到帖子知道了,它解决了我的问题...谢谢你,我道歉,我有一个名字不正确的变量:)。

0 个答案:

没有答案