The information in this article applies to:
SYMPTOMS
In Visual Basic Editor for Microsoft Excel 97, there is no reference to the
OnSave property in the Object Browser.
CAUSEThis behavior is by design in Microsoft Excel 97. 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 97. The OnSave property was introduced in Microsoft Excel for Windows 95, version 7.0, but still can be used in Microsoft Excel 97. The OnSave property returns or sets the name of a Visual Basic procedure to run after the user invokes either the Save or Save As command, but before the workbook is actually saved. Consider the following items when you use the OnSave property:
Macro Example using the OnSave propertyThis example displays a message box after the user invokes either the Save or Save As command, but before the workbook is actually saved:
Run the SetSaveEvent macro. This will set 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 executes before a workbook is saved. This event is new to Microsoft Excel 97.This example prompts the user for either a yes or no response before saving the workbook:
REFERENCESFor more information about the BeforeSave event, click the Index tab in Microsoft Visual Basic Help, type the following text BeforeSaveand then double-click the selected text to go to the "BeforeSave Event" topic. Additional query words: XL97 8.00
Keywords : kbprg kbdta kbdtacode KbVBA |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |