I want to call a java jar file using vb script in excel. My file format is "xlsm" where is my vb script code.
When i execute my code, then console comes and go, I do not what is written on console. please have a look at code
Public Function RunProgram( _
program As String, _
Optional command As String = "" _
) As WshExec
Dim wsh As New WshShell
Dim exec As WshExec
Dim oShell
Application.ScreenUpdating = False
Set exec = wsh.exec(program)
Call exec.StdIn.WriteLine(command)
Set RunProgram = exec
'Application.ScreenUpdating = True
End Function
Public Function evenOdd1(Number As Double) As Double
Call Run
End Function
Public Sub Run()
Dim program As WshExec
Set program = RunProgram("java -jar G:\\excel\\MyTest.jar""Margus")
'Debug.Print "STDOUT: " & program.StdOut.ReadAll
End Sub
I have tried Application.ScreenUpdating, Application.visible to hold the screen but unable to hold console.. Please help me