PC Review


Reply
Thread Tools Rate Thread

Activate an open window and send keystrokes to it.

 
 
Prometheus
Guest
Posts: n/a
 
      6th Apr 2007
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....

 
Reply With Quote
 
 
 
 
matt
Guest
Posts: n/a
 
      6th Apr 2007
On Apr 6, 6:51 am, "Prometheus" <prometheus...@excite.com.au> wrote:
> 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

 
Reply With Quote
 
Prometheus
Guest
Posts: n/a
 
      6th Apr 2007

matt wrote:
> On Apr 6, 6:51 am, "Prometheus" <prometheus...@excite.com.au> wrote:
> > 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


Thanks... nice and easy this one!

 
Reply With Quote
 
Prometheus
Guest
Posts: n/a
 
      6th Apr 2007
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?

 
Reply With Quote
 
matt
Guest
Posts: n/a
 
      10th Apr 2007
On Apr 6, 9:14 am, "Prometheus" <prometheus...@excite.com.au> wrote:
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to activate drop down box using keystrokes not mouse =?Utf-8?B?TGVzbGllYzQwMDA=?= Microsoft Excel Worksheet Functions 4 26th Jan 2007 09:19 PM
Workbook.Activate / Window.Activate problem Tim Microsoft Excel Programming 3 3rd Feb 2006 11:38 PM
How do I open the task view in a new window with keystrokes? =?Utf-8?B?c3lkMjI=?= Microsoft Outlook Discussion 0 15th Jul 2005 06:15 PM
Keystrokes activate desktop items instead of browser page =?Utf-8?B?VG9tbXlU?= Windows XP Internet Explorer 1 25th Jul 2004 09:51 PM
Send keystrokes to a DOS window prompt Alain Riopel Microsoft Access VBA Modules 1 10th Oct 2003 11:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:37 PM.