The information in this article applies to:
SYMPTOMS
In the Visual Basic Editor for Microsoft Excel 98, there is no reference to
the OnSave property in the Object Browser.
STATUSThis is by design in Microsoft Excel 98. MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft Support professionals 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 needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.aspThe OnSave property has been replaced by the BeforeSave event in Microsoft Excel 98. The OnSave property was introduced in Microsoft Excel version 5.0. However, you can still use it in Microsoft Excel 98. The OnSave property returns or sets the name of a Visual Basic procedure that is run after you invoke the Save or Save As command. Note that this procedure is run before the workbook is actually saved. When you use the OnSave property, consider the following:
Macro Example Using the OnSave PropertyThe following example displays a message box after you invoke the Save or Save As command. The message box appears before the workbook is saved.
Run the SetSaveEvent macro. This sets an internal flag in Microsoft
Excel to run the SaveProcedure macro automatically when the active workbook
is saved.
Macro Example Using the BeforeSave EventThe BeforeSave event is executed before a workbook is saved. This event is new in Microsoft Excel 98.The following example prompts you for a yes or a no response before it saves the workbook:
REFERENCES
For more information about the BeforeSave event, from the Visual Basic
Editor, click the Office Assistant, type BeforeSave, click Search, and
then click to view "BeforeSave Event."
Q176476 OFF: Office Assistant Not Answering Visual Basic Questions Additional query words: XL98
Keywords : kbprg kbdta kbdtacode xlvbahowto xlvbainfo xlmac |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |