Article ID: 143452 - Last Review: October 11, 2006 - Revision: 2.2 XL97: Excel Hangs When You Programmatically Save a WorkbookThis article was previously published under Q143452 On This PageSYMPTOMS
When you save a workbook in Microsoft Excel 97, the program may appear to
stop responding (hang), and the following symptoms may occur:
CAUSE
This problem occurs when all of the following conditions are true:
RESOLUTION
To prevent this problem from occurring, add the following code to all
macros that you specify in the OnSave command:
NOTE: When this behavior occurs, you must quit Microsoft Excel by pressing ALT+F4. STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article.
MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
In Microsoft Excel 7.0 and Microsoft Excel 97, you can use the OnSave
property to specify a macro that runs after you initiate saving a workbook,
and before Microsoft Excel saves the workbook.
Example of the ProblemThe following example demonstrates the use of the OnSave property: Turning off Screen UpdatingYou can turn off screen updating while a macro runs by including the following line of code in the macro:When this behavior occurs, Microsoft Excel appears to stop responding (hang). However, the program is not "frozen." The program is not redrawn on the screen correctly, which prevents you from using any part of the program. Example of the ResolutionTo prevent the problem, enable screen updating by resetting the ScreenUpdating property to True before the end of the macro. For example, change the example in the "Example of the Problem" section to the following: | Article Translations
|

Back to the top
