LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Excel 2003 interacting with another program

Looks like what I need, except one additional question

Rather than just waiting and setting the wait for the worst possible case,
is there any way to

1) Test if the other application window has changed?

and even...

2) Check for the first five or ten characters of text in the other window?

"Jacob Skaria" wrote:

Hi Steve

--In order to check whether the the other applicaiton is open or not you can
use FindWindow

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

lnRetVal = FindWindow("NOTES", vbNullString)
If lnRetVal = 0 Then
MsgBox "Application must be open", vbInformation, "App-Name"
Exit Sub
End If

--To activate the window you can use AppActivate

AppActivate "Window caption"

--You can use SendKeys for tab and even for typing a text to the other
application
SendKeys "%F", True
SendKeys "A", True
'GSSWait
SendKeys CStr("c:\imagepro\g\" & arrAttach(x) & ".doc"), True
AppActivate "Create Attachments"
SendKeys "%R", True

--You will have do a lot of testing and put stoppers in between to deal
with the traffic and other programs response...In the above GSSWait is a
procedure to wait for a certain time....Again you will have to adjust the
wait time in between activities...(but the key point is with a lot of testing
and fine tuning you CAN...)


If this post helps click Yes
---------------
Jacob Skaria


"Steve" wrote:

I would like to program Excel 2003 to interact with a particular window in
another program. Essentially it would have to call the other window (already
open), send Alt-letter, tab or Enter command(s) to control its Menu, wait for
the program to change in response to the command(s), copy a string from Excel
and paste it in the other program, send Alt-letter, tab or Enter command(s)
to the program, wait for the other program to respond, send additional
Alt-letter, tab or Enter commands with short pauses in-between (one of which
is copy to clipboard), and finally return control to Excel, paste what was
copied to the clipboard by the other program, then loop to repeat with
another string from Excel and other data returned from the program.

Right now the Excel part is done with a macro, but while the other program
window is the focus it is all manual.

Is it possible to do this? The other program may have more than one window
open so how do I specify the particular window in am interacting with?
Depending on network traffic the speed of the other program's response may
vary (to respond to commands or to produce the data), so how can Excel sense
the changes that I would see as the other program responds, so it would know
when to send or do the next thing?



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
games on excel 2003 program Games will not open Excel Discussion (Misc queries) 0 May 9th 08 09:01 PM
Problem interacting between VB.NET and VBA6 with Excel 2003 Nicholas Dreyer Excel Discussion (Misc queries) 0 April 6th 07 04:07 AM
Problem interacting between VB.NET and VBA6 with Excel 2003 Nicholas Dreyer Excel Programming 0 April 5th 07 05:31 AM
Excel-2003 Plug-In Program kumar_8675 Excel Programming 1 October 26th 04 05:05 AM
Interacting outside Excel Kevin Excel Programming 1 March 2nd 04 02:38 AM


All times are GMT +1. The time now is 10:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"