Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: Alert for Previous Version Is Displayed by Using the OnSave Property


View products that this article applies to.

This article was previously published under Q212030

↑ Back to the top


Symptoms

When you save a workbook to an earlier version of Microsoft Excel, you may receive the following error message, where File name is the name of the workbook that you are trying to save:
File name was created in a previous version of Microsoft Excel. Do you want to update it to the new format?

To update it, click Yes.

To save it in the existing format, click No. Some types of changes may be lost.

↑ Back to the top


Cause

This behavior occurs when you have run a macro that uses the OnSave property of the ActiveWorkbook property, and you are saving to an earlier version of Microsoft Excel.

↑ Back to the top


Workaround

Microsoft 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 a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site: For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site: To avoid receiving this message, temporarily change the default workbook format when you save the workbook. The following macro example illustrates how to do this:
Dim bFlag As Boolean
Sub Auto_Open()
   ' Automatically invoke the OnSave property when user clicks Save
   ' and redirect to the Save_Macro routine.
   ActiveWorkbook.OnSave = "Save_Macro"
End Sub
Sub Save_Macro(bFlag)
   ' Change the default file format to Excel 6.0.
   Application.DefaultSaveFormat = xlExcel6
   ' Save the workbook.
   ActiveWorkbook.Save
   ' Change the default file format back to Excel 2000.
   Application.DefaultSaveFormat = xlWorkbookNormal
End Sub
				

↑ Back to the top


More information

The OnSave property is included in Microsoft Excel 2000 for backward compatibility with earlier versions of Excel. The OnSave property was introduced in Excel for Windows 95, version 7.0, but can still be used in Excel 2000. The OnSave property returns or sets the name of a Visual Basic procedure to run after the user invokes the Save command, but before the workbook is actually saved. The OnSave property has been replaced by the BeforeSave event in Excel 2000.

For additional information about the OnSave property, click the article number below to view the article in the Microsoft Knowledge Base:
213779� XL2000: OnSave Property Is Not Available in Object Browser

↑ Back to the top


References

For more information about the BeforeSave event, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type beforesave event in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

↑ Back to the top


Keywords: KB212030, kbprb, kberrmsg

↑ Back to the top

Article Info
Article ID : 212030
Revision : 7
Created on : 11/23/2006
Published on : 11/23/2006
Exists online : False
Views : 304