Microsoft KB Archive/59296

{|
 * width="100%"|

Macro to Test Whether Windows Application Is Loaded

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, versions 2.x, 3.0, 4.0, 5.0

-

SUMMARY
The following command macro tests to see if a Windows application is currently loaded without activating the application.

The macro code is as follows, starting in cell A1 of the macro sheet:

  A1: IsAppLoaded A2: =REGISTER(&quot;KERNEL&quot;,&quot;GetModuleHandle&quot;,&quot;IC&quot;) A3: =CALL(A2,B1) A4: =RETURN

In this example, the name of the application being referenced is kept as text in cell B1. If the application is loaded, a nonzero value is returned in cell A3. If the application is not loaded, A3 contains 0 (zero).

Note that the application name in cell B1 should be in the form of the name of the application executable without the .EXE or .COM extension. For example, the correct text to test for Microsoft Word for Windows is &quot;WINWORD&quot; (without the quotation marks).

Note: the information above also applies to version 5.0 only when using version 4.0 macro language.

Additional query words: 2.0 2.00 2.01 2.1 2.10 3.0 4.0 5.0 check running

Keywords :

Version :

Platform :

Issue type :

Technology :