Excel Temporarily Hangs After Running Word for Windows MacroLast reviewed: July 30, 1997Article ID: Q95490 |
The information in this article applies to:
SUMMARYIf 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 1Remove 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 2Add 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 INFORMATIONIf 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |