Saved property of the workbook. The Saved property returns a True or False value depending on whether changes have been made to the workbook. Note that it is possible to set the Saved property to True or False. The "More Information" section of this article contains sample macros that demonstrate the use of the Saved property.
Various conditions in your worksheet, such as the presence of volatile functions, may affect the Saved property. For additional information about these conditions, please click the article number below to view the article in the Microsoft Knowledge Base:
XL: "Save Changes in <Bookname>" Prompt Even If No Changes Made
Example 1: Macro to Display Message If Active Workbook Has Unsaved Changes
If ActiveWorkbook.Saved = False Then
MsgBox "This workbook contains unsaved changes."
Example 2: Macro to Close Workbook and Discard ChangesThis macro closes the workbook that contains the sample code and discards any changes to the workbook by setting the Saved property to True:
ThisWorkbook.Saved = True
Example 3: Another Macro to Close Workbook and Discard Changes
ID d'article : 213634 - Dernière mise à jour : 23 janv. 2007 - Révision : 1