The information in this article applies to:
SUMMARYThe following is an example of a Microsoft Visual Basic for Applications macro that automatically saves all files that have been previously saved. If files are open that have not been previously saved, a dialog box will prompt the user for a file name. 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.aspIn Microsoft Excel, you can use the AUTOSAVE.XLA add-in macro to save all open documents automatically as you work. If you prefer not to have your documents automatically saved, but would like to save all open documents at one time, use the following sample Visual Basic for Applications macro:
After you create the macro, do the following to create a menu item and
assign the macro to it:
Microsoft Excel 5.0 or 7.0
Microsoft Excel 97 or Microsoft Excel 98
or in an existing workbook. To make the menu choice always available in Microsoft Excel, store the macro and make the menu changes in the Personal Macro Workbook. REFERENCES
"Visual Basic User's Guide," version 5.0, Chapter 12, "Creating Menuing
Items"
Menu EditorFor additional information, please see the following article in the Microsoft Knowledge Base: Q76442 Macro to Save All Open Worksheets in Excel Additional query words: 5.00a 5.00c 7.00a 97 98 XL5 XL7 XL97 XL98 menubar
Keywords : kbprg kbdta kbdtacode PgmHowto KbVBA |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |