Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Open Winword-file using a Excel 97 VBA macro

Hi,
I am working with Excel 97 and would like to open a
specific Word 97 .doc file with a macro. Does anybody have
know how to do that? (actually I know how to do it with
Excel 2000 but not with Excel 97...)
Thank you very much
Dominik
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Open Winword-file using a Excel 97 VBA macro

Should not be any significant difference between how you do it in xl2000 and
how you do it in xl97. Assume you are using either automation or shell.

Regards,
Tom Ogilvy

"Dominik Scheck" wrote in message
...
Hi,
I am working with Excel 97 and would like to open a
specific Word 97 .doc file with a macro. Does anybody have
know how to do that? (actually I know how to do it with
Excel 2000 but not with Excel 97...)
Thank you very much
Dominik



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Open Winword-file using a Excel 97 VBA macro

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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Open Winword-file using a Excel 97 VBA macro

Dominik:

I open a Word document from within an Excel macro using Word2000,
Excel2000, in Win2000, with

Dim Word As New Word.Application
Dim WordDoc As New Word.Document
Dim Doc As String

Doc = "C:\Documents and Settings\emillis\Desktop\File Paths.doc"
Set WordDoc = Word.Documents.Open(Doc)

One of the things that kept giving me errors was that I had neglected to
reference Word objects.

HTH
Ed

"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



  #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



Reply
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 01:29 PM.

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"