Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
games on excel 2003 program | Excel Discussion (Misc queries) | |||
Problem interacting between VB.NET and VBA6 with Excel 2003 | Excel Discussion (Misc queries) | |||
Problem interacting between VB.NET and VBA6 with Excel 2003 | Excel Programming | |||
Excel-2003 Plug-In Program | Excel Programming | |||
Interacting outside Excel | Excel Programming |