ERLANDSEN DATA CONSULTING Excel & VBA Tips   Informasjon på norsk / Information in Norwegian

These pages are no longer updated and are only available for archive purposes.

Click here to visit the pages with updated information.

Determine if an application is available

You can use the two functions below to determine if an application is already running or if it is available on the host computer:

Function ApplicationIsRunning(ApplicationClassName As String) As Boolean
' returns True if the application is running
' example: If Not ApplicationIsRunning("Outlook.Application") Then Exit Sub
Dim AnyApp As Object
  On Error Resume Next
  Set AnyApp = GetObject(, ApplicationClassName)
  ApplicationIsRunning = Not AnyApp Is Nothing
  Set AnyApp = Nothing
  On Error GoTo 0
End Function

Function ApplicationIsAvailable(ApplicationClassName As String) As Boolean
' returns True if the application is available
' example: If Not ApplicationIsAvailable("Outlook.Application") Then Exit Sub
Dim AnyApp As Object
  On Error Resume Next
  Set AnyApp = CreateObject(ApplicationClassName)
  ApplicationIsAvailable = Not AnyApp Is Nothing
  Set AnyApp = Nothing
  On Error GoTo 0
End Function

 

Document last updated 2000-04-12 12:49:31      Printerfriendly version

User comments:
Ole P. from Norway wrote (2005-12-20 20:10:00 CET):
Re: very nice
You probably need to use something like this:
Set obj = CreateObject("MODI.Document")
This object can contain images where you set the compression type to e.g. TIFF.
For details, set a reference to the MS Office Document Imaging type library and use the Object Browser (press F2) to view details.
ILYAS KAZI from INDIA wrote (2005-12-20 15:52:14 CET):
very nice
may i know what is the application class name for TIFF (Microsoft office document imaging)

 

Erlandsen Data Consulting     http://www.erlandsendata.no/   
Excel & VBA Tips   Copyright ©1999-2017    Ole P. Erlandsen   All rights reserved
E-mail Contact Address