When you programmatically save a workbook in Excel, a menu command does not run in the BeforeSave event (898511)
The information in this article applies to:
- Microsoft Office Excel 2003
- Microsoft Excel 2002
- Microsoft Excel 2000
SYMPTOMSYou programmatically save a workbook in Microsoft Office Excel 2003. If you try to perform a menu command in an event, such as the BeforeSave event, the menu command does not run.CAUSEThis issue occurs because a menu command cannot be nested in the code when you programmatically call a menu command such as the Save command. The menu command in the BeforeSave event is specifically blocked from running.
WORKAROUNDTo work around this issue, manually save the workbook. To manually save the workbook, click Save on the File menu. When you use this workaround, you can perform any one of the following menu commands in the BeforeSave event: - Any command on the Format menu.
- The Clear command on the Edit menu.
- The Delete command on the Edit menu.
- The Delete rows command on the Edit menu.
- The Print command on the File menu.
Modification Type: | Major | Last Reviewed: | 7/19/2005 |
---|
Keywords: | kbmacro KbVBA kbProgramming kbAutomation kbtshoot kbprb KB898511 kbAudEndUser kbAudDeveloper |
---|
|