Opening Other applications


Posted by Mark Crawford on February 07, 2002 3:42 AM

I'm having a bit of trouble.
I need to open microsoft word from excel in a macro. I've tried doing it from Access and then copying the code but that does't work. Does anyone know the code for opening word from excel in a macro.

Cheers.



Posted by DK on February 07, 2002 4:09 AM

Hi Mark,

There are a few ways you can do this. Here's one...

Sub OpenWord()
Dim wdApp As Object
Set wdApp = CreateObject("Word.Application")
wdApp.Visible = True

'You can now work with Word from within Excel code e.g
wdApp.documents.Open "c:\test.doc"

End Sub

Any other questions, let me know,
D