Macro to open other applications

  • Thread starter Thread starter Sherry
  • Start date Start date
S

Sherry

Is it possible to run a macro within excel to open other
applications like word?

My macro keeps returning the following error: "File format
is not valid".

Thanks
 
You need more than GetObject, as the app may not be instantaited already.
Something like

On Error Resume Next
Set WDApp = GetObject(, "Word.Application")
If WDApp Is Nothing Then
Set WDApp = CreateObject("Word.Application")
If WDApp Is Nothing Then
Exit Sub
End If
End If

... do your stuff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top