» Determine if an application is available using VBA in Microsoft Excel
VBA macro tip contributed by Erlandsen Data Consulting offering Microsoft Excel Application development, template customization, support and training solutions
CATEGORY - Applications - Word, Outlook in VBA
VERSION - All Microsoft Excel Versions
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
Book Store:
Recommended Books:
- Microsoft Word Version 2002 Inside Out
- The 22 Immutable Laws of Branding
- Dictionary of Finance and Investment Terms
- Microsoft Windows XP Step by Step (With CD-ROM)
- Preparing the Marketing Plan (Ama Marketing Toolbox Series New Edition)
- Millionaire Real Estate Mentor : The Secrets of Financial Freedom through Real Estate Investing
No comments have been submitted.


