Open Winword-file using a Excel 97 VBA macro
You don't need both createobject and new. If you use new you need to have a
reference to the word object library, so createobject might be more
flexible:
Dim obwrd As Object
Set obwrd = CreateObject("word.application")
obword.documents.Open ThisWorkbook.Path & "\\szrh101" & _
"\biam\Bond\Euro\Euro Corp\Miss Daisy\Help\Daisy.doc"
obword.Visible = True
Note that the extension in your sample was dco rather than doc
Should work.
Regards,
Tom Ogilvy
Dominik Scheck wrote in message
...
Hello Tom, thanks for your answer:
I have got the following code but it does not run under
Excel 97 (gives me: User-defined type not defined!!):
Dim obwrd As Object
Set obwrd = CreateObject("word.application")
Dim obwrd As Word.Application
Set obword = New Word.Application
obword.documents.Open ThisWorkbook.Path & "\\szrh101
\biam\Bond\Euro\Euro Corp\Miss Daisy\Help\" & Daisy.dco
obword.Visible = True
Can you help me with shell? I have tried it but i could
not manage....
Thank you very much!!!!
Dominik
|