我在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
编辑:我刚看到帖子知道了,它解决了我的问题...谢谢你,我道歉,我有一个名字不正确的变量:)。