Excel Temporarily Hangs After Running Word for Windows Macro

Last reviewed: July 30, 1997
Article ID: Q95490
The information in this article applies to:
  • Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c
  • Microsoft Excel for Windows, versions 3.0, 4.0
  • Microsoft Windows operating system versions 3.0, 3.1

SUMMARY

If you run a Microsoft Word for Windows macro from Microsoft Excel for Windows using DDE, Excel may temporarily hang (stop responding) if the Word macro contains the FileExit command. This happens if Word is minimized when you launch the macro from Excel. It does not happen if Word is maximized when you launch the macro from Excel.

When this happens, an error appears in the Excel spreadsheet cell from which you launched the Word macro. In Word, the following error message occurs after several seconds:

   Microsoft Word: This task is taking longer than expected.
   Do you want to continue waiting?

If you choose the Yes button, Excel continues to hang temporarily and Word does not close. If you choose the No button, Word appears to close and Excel stops hanging.

Workaround 1

Remove the FileExit command from the WordBasic macro and send it as a separate command from Microsoft Excel, via DDE. The following is a sample Excel macro that sends the FileExit command to Word:

   A1: =INITIATE("winword","system")
   A2: =EXECUTE(A1,"[ToolsMacro.Name=""test"",.Run]")
   A3: =EXECUTE(A1,"[FileExit]")
   A4: =TERMINATE(A1)
   A5: =RETURN()

Workaround 2

Add the AppMaximize command to your Word for Windows macro before the FileExit command, as shown in the following sample macro:

   Sub Main
   AppMaximize
   FileExit
   End Sub

MORE INFORMATION

If you later attempt to launch Word after you receive the "This task is taking longer..." error message, the following error message occurs if you are not running the MS-DOS Share utility:

   Word is already running.

This happens even though Word is not running because a portion of the Word program still resides in memory. If this happens, exit and restart Windows.

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Reference(s):

"Microsoft Excel User's Guide 2," version 4.0, pages 299-304

"Microsoft Excel User's Guide," version 3.0, pages 341-344

"Microsoft Excel Function Reference," version 4.0, pages 139-140

"Microsoft Excel Function Reference," version 3.0, pages 71-72


KBCategory: kbmacro
KBSubcategory:
Additional query words: 4.0 3.0 2.0 2.0a 2.0a-CD 2.0b 2.0c
winword2 hang hung crash crashed locks locked frozen freezes crashing
quit quits wait too long dynamic data exchange link winword
errmsg err msg


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.