Saving and Using an Excel 2007 Macro-Enabled Workbook
When you're working with macros in Excel 2007, you save and open workbooks in a new macro-enabled workbook format (.xlsm) that provides added security. When you create a macro, you must use this format to save your workbook or the macro won't be saved.
If you open a macro-enabled workbook, a Security Warning message states that the workbook contains macros. This protects you from possible harm because some macros might contain viruses or other hazards. You can choose to enable the content if the workbook is from a trusted source.
Save a macro-enabled workbook
Follow these steps to save a macro-enabled workbook:
Click the Office button and then click Save As.
The Save As dialog box appears.
Enter a name and select a location for your workbook.
Click the Save as Type drop-down arrow.
A list of file types appears.
Select Excel Macro-Enabled Workbook (*.xlsm).
Excel adds the .xlsm extension to the filename.
If you create a macro in a workbook and neglect to save the workbook in the proper format, you see a warning message telling you that the macro will not be retained.
Using a macro-enabled workbook
To open a macro-enabled workbook, follow these steps:
Open a workbook containing a macro in the same way you open any other workbook.
The workbook opens as usual but a Security Warning message appears below the Ribbon.
Click the Options button beside the Security Warning.
The Microsoft Office Security Options dialog box appears.The Microsoft Office Security Options dialog box.
If you know where the macro originated, select Enable This Content.
The dialog box closes, along with the Security Warning message, and you're free to use the macros in that workbook.