

In Microsoft Office Excel 2003 and in earlier versions of Excel, choose Macro from the Tools menu, and then click Macros. Type the sample macro code into the module sheet. Press ALT+F11 to start the Visual Basic editor. To prepare for implementing either of the examples below, perform these steps first: However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Microsoft support engineers can help explain the functionality of a particular procedure. 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. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. NOTE: Microsoft provides programming examples for illustration only, without warranty either expressed or implied.

This can be done either by specifying the state of the workbook Saved property, or by suppressing all alerts for the workbook. In Microsoft Excel, you can create a Microsoft Visual Basic for Applications (VBA) macro that suppresses the Save Changes prompt when you close a workbook.
