View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Henrich Henrich is offline
external usenet poster
 
Posts: 53
Default open word from excel...file does not exist error

Hi, im using this and it's working. Don't use CreateObject but GetObject like
this:

Dim Word As Object
Dim MyXL As Object

Sub Open_Wordfile()

Set Word = GetObject("C:\Documents and Settings\files\Test.doc")
Set MyXL = GetObject(, "Word.application")
MyXL.Application.Visible = True

End Sub

€žtbaam" napÃ*sal (napÃ*sala):

I am trying to open a word dopcument from excel...below is the code I am
running but I receive the following error....that is runtime error
524...which indicates that the file does not exit...but it does. I searched
through the other questions and did make sure that the microsoft Word 11.0
object library is available. What am I still doing wrong.

Sub OpenAWordDoc()
Dim WordApp As Object, WorddDoc As Object

Set WordApp = CreateObject("Word.Application")
WordApp.Documents.Open "C:\Documents and Settings\files\Test.doc"
WorddApp.Visible = True

End Sub