Send keystrokes to a DOS window prompt

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 !
 
G

Geoff

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top