Microsoft KB Archive/189983

= XL98: Macro to Save the Personal Macro Workbook Without Prompt =

Article ID: 189983

Article Last Modified on 6/17/2005

-

APPLIES TO


 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q189983



SUMMARY
When you edit the Personal Macro Workbook in Microsoft Excel 98 Macintosh Edition, you are prompted to save changes when you quit the program.

This article describes how to create a macro that will suppress the dialog box and will automatically save the changes to the Personal Macro Workbook when you close the file.



MORE INFORMATION
The Personal Macro Workbook in Microsoft Excel is used to store custom macros. This workbook is located in the Microsoft Office 98:Office:Startup:Excel folder.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements. To automatically save the Personal Macro Workbook when you quit Microsoft Excel, follow these steps:

 On the Tools menu, point to Macro, and then click Visual Basic Editor. Press COMMAND+R to activate the Project Explorer window. In the Project Explorer window, click the VBAProject (Personal Macro Workbook) item. On the Insert menu, click Module.  In the module, type the following code: Sub Auto_Close ThisWorkbook.Save End Sub  On the File menu, click "Close And Return To Microsoft Excel." On the File menu, click Quit.</li></ol>

You will not be prompted to save the Personal Macro Workbook when you quit Microsoft Excel, but your changes to the workbook will be saved.

When you open Microsoft Excel, the Personal Macro Workbook opens automatically, but it is hidden. If you record a macro into the Personal Macro Workbook or edit a macro in the Personal Macro Workbook, you will be prompted to save your changes to the workbook when you quit Microsoft Excel.

NOTE: Hiding and unhiding the workbook is considered a change, and you will be prompted to save changes when you quit Microsoft Excel.

Additional query words: XL98

Keywords: kbhowto kbprogramming kbdtacode KB189983

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.