AgathaKare
New Member
- Joined
- Nov 19, 2013
- Messages
- 1
I need to 1. launch cygwin from VBA, 2. run an executable with inputs and 3. wait for it to finish. I have had success doing steps 1 and 2 OR steps 1 and 3, but cannot figure out all 3.
For steps 1 and 2:
ReturnValue = Shell("C:\cygwin\Cygwin.bat", 1)
SendKeys "S{ENTER}" (this is only one example SendKeys, but I actually have several)
For steps 1 and 3:
Dim wsh As Object
Set wsh = VBA.CreateObject("WScript.Shell")
ReturnValue = wsh.Run("C:\cygwin\Cygwin.bat", "yftedit", windowStyle, waitOnReturn)
For the second bit of code up there, it seems to be waiting for the window to close before going to the next line in VBA (which is my SendKeys to pass the input Cygwin needs to continue).
How can I pass commands to cygwin and wait for the execution to finish?
For steps 1 and 2:
ReturnValue = Shell("C:\cygwin\Cygwin.bat", 1)
SendKeys "S{ENTER}" (this is only one example SendKeys, but I actually have several)
For steps 1 and 3:
Dim wsh As Object
Set wsh = VBA.CreateObject("WScript.Shell")
ReturnValue = wsh.Run("C:\cygwin\Cygwin.bat", "yftedit", windowStyle, waitOnReturn)
For the second bit of code up there, it seems to be waiting for the window to close before going to the next line in VBA (which is my SendKeys to pass the input Cygwin needs to continue).
How can I pass commands to cygwin and wait for the execution to finish?