ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to open other applications (https://www.excelbanter.com/excel-programming/312219-macro-open-other-applications.html)

sherry

Macro to open other applications
 
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

Bill[_28_]

Macro to open other applications
 
Look at the GetObject information. e.g,

Set WDApp = GetObject(, "Word.Application")


"Sherry" wrote in message
...
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




Bob Phillips[_6_]

Macro to open other applications
 
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

--

HTH

RP

"Bill" wrote in message
...
Look at the GetObject information. e.g,

Set WDApp = GetObject(, "Word.Application")


"Sherry" wrote in message
...
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







All times are GMT +1. The time now is 03:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com