Send keystrokes to a DOS window prompt

  • Thread starter Thread starter Alain Riopel
  • Start date Start date
A

Alain Riopel

Hi,

I need to automate the transfer of datat that is now
manually done between Office programs (Excel or Access)
and an old DOS executable, running in a DOS shell.

It seems like the "SENDKEYS" method won't work.

1. Is there a way to make "SENDKEYS" to work ?

2. I noticed that I can use a "copy & paste" approach
between Office applications and the DOS program. Is there
a way to force a "PASTE" in the DOS window from the Office
application ?

Any help or idea would be very welcome ! - Thanks !
 
Alain

This may help:

Create a batch file to automate the data transfer
using the old DOS application.

Create a shortcut (ie a PIF file) to run the batch
file. Set the shortcut's properties to "close on exit"
(ie to close the DOS window when the batch file
finishes).

Run the shortcut using the shell function.

If you need to create a batch file using vba,
create a reference to the Microsoft Scripting
Runtime object library and use the TextStream
object.

Regards.
Geoff
 
Back
Top