XL98: Macro to Save the Personal Macro Workbook Without Prompt (189983)



The information in this article applies to:

  • Microsoft Excel 98 Macintosh Edition

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:

  1. On the Tools menu, point to Macro, and then click Visual Basic Editor.
  2. Press COMMAND+R to activate the Project Explorer window.
  3. In the Project Explorer window, click the VBAProject (Personal Macro Workbook) item.
  4. On the Insert menu, click Module.
  5. In the module, type the following code:
          Sub Auto_Close()
             ThisWorkbook.Save
          End Sub
    						
  6. On the File menu, click "Close And Return To Microsoft Excel."
  7. On the File menu, click Quit.
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.

Modification Type:MajorLast Reviewed:6/17/2005
Keywords:kbdtacode kbhowto kbProgramming KB189983