View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default loading another application from excel vba

Have you tried capturing an error when setting the object?

Dim oApp As Object
On Error GoTo NotAvailable
Set oApp = CreateObject("NameOfApp.application") 'As appropriate
GoTo Available
NotAvailable:
MsgBox "Application was NOT available on this machine"
Exit Sub
Available:
MsgBox "Application IS available on this machine"
'Othe code here


It would be done like this for Word:

Dim oWord As Object
On Error GoTo NotAvailable
Set oWord = CreateObject("word.application")
GoTo Available
NotAvailable:
MsgBox "Word was NOT available on this machine"
Exit Sub
Available:
MsgBox "Word IS available on this machine"

HTH,
Bernie
MS Excel MVP


"badazizi" wrote in message
...
I want to be able to launch another vba-enabled application from an Excel
command button. I have the code and references to do this already. However,
I need to figure out how I can programmatically check to see if the computer
has the application installed before I try to dim an object for the
application. I need to do this because the Excel file would be used by
people that don't have the application as well as those that do. I want to
give the users that don't a meaningful error if they don't have it. How
would I go about doing that?