Is there anyway to launch a DOS Program and execute some keystrokes?
There is a DOS program I need to use but it is cumbersome. It involves entering some data paramaters and letting the program calculate something. The problem is I have multiple scenarios and it is tedious to enter all that over and over again (sometimes changing only one value).
I was wondering if there is a way to launch the DOS program from Access and enter the values from a table automatically into the DOS program?
Here's what I need to do in the DOS program.
- DOS Program Starts
- Press Enter to Continue
- Name File
- (Please Wait) - Program does something, I think it creates a file or something.
- Enter Description
- Enter M or E
- Enter Y or N
- Enter Value (Integer)
- Enter Value (Integer)
- Enter Value (Integer)
- Enter Value (Integer)
- Enter Value (Integer)
- Enter Value (Integer)
- Enter Y or N
- Enter H or S
- Enter Value (Integer)
- Enter Value (Decimal)
- Enter Value (Integer)
- Enter Value (Decimal)
- Enter â1 (To Finish)
I've tried
Code:
Dim retVal
retVal = Shell("C:\TNMLook\TNMLook.exe", 1)
AppActivate retVal
SendKeys "{Enter}", True
SendKeys "myfilenamehere{Enter}", True
SendKeys "mydescriptionhere{Enter}", True
SendKeys "MorEenteredHere{Enter}", True
AppActivate retValDOS Program opens but I get the following error message with the line below.
Run-time error '5':
Invalid procedure call or argument.
Removing that line doesn't work either. When I do that, it actually opens the DOS Program twice now?! Then it enters a bunch of
\s'...
Any ideas?