LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Excel file from VB and open MACRO no1jimmyman Excel Discussion (Misc queries) 0 February 14th 11 10:10 PM
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
create a macro to automatically open excel another excel file [email protected] uk Excel Discussion (Misc queries) 1 July 20th 08 09:21 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
Open an Excel file with a date as today in a macro Perry Excel Discussion (Misc queries) 4 November 10th 05 09:57 AM


All times are GMT +1. The time now is 08:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"