Tuckabag
Petroleum
- May 10, 2010
- 125
Hi,
I am trying to incorporate via VBA opening a CMD shell to run an old DOS program, enter some values and then capture the results to paste back into Excel.
So far I can open the Shell, run the program and send keystrokes as required using the below VBA code.
However, I cannot find a way to take a screenshot, or copy/paste the resulting data shown in the Shell and dump it back into VBA/Excel.
I have found alternate methods to open the Shell, run the .exe file AND capture data from the Shell screen, however none of these methods have :
Without being able to send keystrokes, I can't get the program to produce the data required, so the screen captures are useless.
It would be nice if I could send command line arguments to it, but the software doesn't support this.
Any thoughts as I've exhausted my usual avenues of google....
Cheers.
I am trying to incorporate via VBA opening a CMD shell to run an old DOS program, enter some values and then capture the results to paste back into Excel.
So far I can open the Shell, run the program and send keystrokes as required using the below VBA code.
works = "C:\Hydoff\hydoff.exe"
Shell (works), vbNormalFocus
Application.Wait (Now + TimeValue("00:00:03"))
SendKeys "~"
Shell (works), vbNormalFocus
Application.Wait (Now + TimeValue("00:00:03"))
SendKeys "~"
However, I cannot find a way to take a screenshot, or copy/paste the resulting data shown in the Shell and dump it back into VBA/Excel.
I have found alternate methods to open the Shell, run the .exe file AND capture data from the Shell screen, however none of these methods have :
1) Kept the Shell in focus
2) Allowed me to send keystrokes.
2) Allowed me to send keystrokes.
Without being able to send keystrokes, I can't get the program to produce the data required, so the screen captures are useless.
It would be nice if I could send command line arguments to it, but the software doesn't support this.
Any thoughts as I've exhausted my usual avenues of google....
Cheers.