ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel interacting with another program, continued from 8/9/09 thre (https://www.excelbanter.com/excel-programming/432315-excel-interacting-another-program-continued-8-9-09-thre.html)

Steve

Excel interacting with another program, continued from 8/9/09 thre
 
Thanks for help so far - I'm getting close.

Using SendKeys, I send commands to another (non-Office) program that is
activated. Its old window ("Aux Interval") disappears and is eventually (in 1
to 15 seconds) replaced with a new one ("Aux Interval - Steve") having info
on the person named in the title bar. The new window still has the focus, so
I don't need to activate it. How can I check when it appears so Excel can
continue sending commands?

Jacob Skaria wrote:

--In order to check whether the the other application 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


I am having trouble adapting this to my specific situation in Excel 2003.
The computer is on a network with lots of other stuff running in the
background.

Jacob Skaria

Excel interacting with another program, continued from 8/9/09 thre
 
Hi Steve

Check out the below link on how to get a window handle without specifying an
exact title...

http://support.microsoft.com/kb/147659

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


"Steve" wrote:

Thanks for help so far - I'm getting close.

Using SendKeys, I send commands to another (non-Office) program that is
activated. Its old window ("Aux Interval") disappears and is eventually (in 1
to 15 seconds) replaced with a new one ("Aux Interval - Steve") having info
on the person named in the title bar. The new window still has the focus, so
I don't need to activate it. How can I check when it appears so Excel can
continue sending commands?

Jacob Skaria wrote:

--In order to check whether the the other application 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


I am having trouble adapting this to my specific situation in Excel 2003.
The computer is on a network with lots of other stuff running in the
background.



All times are GMT +1. The time now is 06:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com