ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Procedure to detect if an application is running (https://www.excelbanter.com/excel-programming/315469-procedure-detect-if-application-running.html)

Bill

Procedure to detect if an application is running
 
I have the following procedure to detect if an application is running and
registers it:

Sub DetectExcel()
Const WM_USER = 1024
Dim hWnd as Long
hWnd = FindWindow("XLMAIN",0)
If hWnd = 0 Then
Exit Sub
Else
SendMessage hWnd, WM_USER + 18, 0, 0
End If
End Sub

This obviously applies to Excel. How do I accomplish the same thing in terms
of Word?

Thanks,
Bill

Ivan F Moala[_36_]

Procedure to detect if an application is running
 

Hi Bill

Try replacing the Excels classname with Words classname:=OpusApp
why do you want to register it this way?

Also shouldn't the 0 be VbNullString ??

HTH


--
Ivan F Moala


------------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...fo&userid=1954
View this thread: http://www.excelforum.com/showthread...hreadid=274344



All times are GMT +1. The time now is 01:42 PM.

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