Excel: WordBasic Macro with FileExit Command Hangs ComputerLast reviewed: January 3, 1997Article ID: Q94632 |
The information in this article applies to:
SUMMARYMicrosoft Excel for Windows hangs when you run a WordBasic macro that contains a FileExit command. This problem occurs under the following conditions:
MORE INFORMATIONYou can use DDE to run WordBasic macros from a Microsoft Excel macro. When the WordBasic macro contains the FileExit command, Microsoft Excel returns an error to the cell in the macro sheet containing the Execute statement and temporarily hangs your computer. After 30 seconds to a minute, you will be able to use your computer; however, the FileExit command will not successfully close Microsoft Word for Windows (this command should close Microsoft Word). If you switch to Word for Windows, you will receive the following error message:
Microsoft Word: This task is taking longer than expected. Do you want to continue waiting?If you choose the Yes button in the error message dialog box, Word for Windows will not be closed and your computer will continue to hang. If you choose the No button in the error message dialog box, you will close Microsoft Word.
WorkaroundTo work around this problem, remove the FileExit command from the WordBasic macro and instead use DDE to execute this command. A sample macro follows:
A1: =INITIATE("winword","system") A2: =EXECUTE(A1,"[ToolsMacro.Name=""test"",.Run]") A3: =EXECUTE(A1,"[FileExit]") A4: =TERMINATE(A1) A5: =RETURN()The above macro initiates a DDE channel to Word for Windows and runs a macro called Test. Once the macro is completed, Word for Windows will quit and the channel is terminated.
REFERENCES"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: kbprb
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |