Activate an open window and send keystrokes to it.

P

Prometheus

G'day all,

Is there a way to use and excel macro to activate an open window (non-
excel based) and send keystrokes to it?

For Example I need the macro to activate "TTWin Session 1" window open
on my screen and send various keystrokes in order to navigate through
the terminal.

Is it possible and if so how?

Cheers all....
 
M

matt

G'day all,

Is there a way to use and excel macro to activate an open window (non-
excel based) and send keystrokes to it?

For Example I need the macro to activate "TTWin Session 1" window open
on my screen and send various keystrokes in order to navigate through
the terminal.

Is it possible and if so how?

Cheers all....

This is possible; however, SendKeys should be a last resort. If the
system has DDE (Dynamic Data Exchange) then DDE would be a better
alternative (search VBE Help for dde). Otherwise, in short the
following should work (it uses SendKeys).

AppActivate "TTWin Session 1"
Application.SendKeys "c", True
'search VBE Help for SendKeys to see how to use all keyboard
combinations.

Matt
 
P

Prometheus

matt said:
This is possible; however, SendKeys should be a last resort. If the
system has DDE (Dynamic Data Exchange) then DDE would be a better
alternative (search VBE Help for dde). Otherwise, in short the
following should work (it uses SendKeys).

AppActivate "TTWin Session 1"
Application.SendKeys "c", True
'search VBE Help for SendKeys to see how to use all keyboard
combinations.

Matt

Thanks... nice and easy this one!
 
P

Prometheus

Follow up question if I may....

Can Excel through VBA "read" information from the TTWin window.

The window is a Terminal window with Text only. Is is possible to get
Excel to read for example characters 2-4 of Line 5 of the Terminal and
place on a sheet?
 
M

matt

Follow up question if I may....

Can Excel through VBA "read" information from the TTWin window.

The window is a Terminal window with Text only. Is is possible to get
Excel to read for example characters 2-4 of Line 5 of the Terminal and
place on a sheet?

The only way that I can think that this would be possible is through
DDE or through adding the library files. The issue with both of these
though is figuring out how the objects, properties, and methods act
when used in the VBA code.

If you want to add a library, within VBE you can go to Tools/
References and find the library that corresponds to that program. In
essence, you'd have to do a lot of "playing around" to figure it out;
especially if the program is not widely used and you can't simply post
to google groups or some other website to get help.

Matt
 

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