Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Alex St-Pierre Alex St-Pierre is offline
external usenet poster
 
Posts: 3
Default Merge from Excel - takes 1 min. to open the word document

Hi!
I have a macro in Excel (not the datasource of the mailmerge) that open
Word documents. It takes 1-2 minutes to open the word document (mailmerge)
since it is linked to an excel datasource (using DDE method). If the same
macro that open the word document is run from Word, it takes 2 seconds to
open the same document. Any idea?

Dim appWord as Word.Application
Dim docWord as Word.Document
Set appWord = New Word.Application
Set docWord = appWord.Documents.Open("V:\file.doc") 'Takes 1-2 min..

Thank you!
Alex
--
Alex St-Pierre
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Merge from Excel - takes 1 min. to open the word document

1. When I run the macro from Excel, I get one more instance of EXCEL.EXE
than when I run the macro from Word. It is possible that starting a new
instance could d=cause a problem, particularly if your copy of Excel
runs startup code, but here, Excel startup is quite fast. So...

2. ...my guess is that
a. the delay is because Word first tries to make a connection with the
existing instance of Excel, but cannot. Perhaps Excel blocks inbound DDE
conversations when it is running a macro? (It does not seem to mae a
difference whether you are actually running the macro from the VBA
editor or using e.g. Tools-Macros, with the VB Editor closed.)
b. What probably happens is that Word tries to connect, does not
receive an immediate response from Excel, waits, and eventually times
out and creates a new instance of Excel instead.

Unfortunately, even if that is a correct analysis, I don't see any way
to avoid the situation, except "avoid making this type of connection
when automating a Word document from Excel".

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

Alex St-Pierre wrote:
Hi!
I have a macro in Excel (not the datasource of the mailmerge) that open
Word documents. It takes 1-2 minutes to open the word document (mailmerge)
since it is linked to an excel datasource (using DDE method). If the same
macro that open the word document is run from Word, it takes 2 seconds to
open the same document. Any idea?

Dim appWord as Word.Application
Dim docWord as Word.Document
Set appWord = New Word.Application
Set docWord = appWord.Documents.Open("V:\file.doc") 'Takes 1-2 min..

Thank you!
Alex

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
when I open Word or Excel it takes a long time Doreen[_2_] Microsoft Word Help 0 May 18th 09 12:45 PM
MS Word Mail Merge from Excel -- Force Excel to open the datafile? [email protected] Mailmerge 6 September 26th 08 03:08 PM
Word 2002 takes long time to open Word document with missing templ Kelvin Microsoft Word Help 0 September 12th 05 11:52 AM
Word takes 20 seconds to start, Excel takes 1 second. Why? Z-Rey Microsoft Word Help 1 April 9th 05 01:10 AM
Word 2003 takes 20secs to open document. Jason Langoulant Microsoft Word Help 2 December 13th 04 02:42 AM


All times are GMT +1. The time now is 12:41 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"