Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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 | |
|
|
![]() |
||||
Thread | Forum | |||
when I open Word or Excel it takes a long time | Microsoft Word Help | |||
MS Word Mail Merge from Excel -- Force Excel to open the datafile? | Mailmerge | |||
Word 2002 takes long time to open Word document with missing templ | Microsoft Word Help | |||
Word takes 20 seconds to start, Excel takes 1 second. Why? | Microsoft Word Help | |||
Word 2003 takes 20secs to open document. | Microsoft Word Help |