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:

  1. Click the Office button and then click Save As.

    The Save As dialog box appears.

  2. Enter a name and select a location for your workbook.

  3. Click the Save as Type drop-down arrow.

    A list of file types appears.

  4. Select Excel Macro-Enabled Workbook (*.xlsm).

    Excel adds the .xlsm extension to the filename.

  5. Click Save.

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.

A warning message appears if you forget to save a workbook containing a macro as a macro-enabled wo
A warning message appears if you forget to save a workbook containing a macro as a macro-enabled workbook.

Using a macro-enabled workbook

To open a macro-enabled workbook, follow these steps:

  1. 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.

  2. Click the Options button beside the Security Warning.

    The Microsoft Office Security Options dialog box appears.

    The Microsoft Office Security Options dialog box.
    The Microsoft Office Security Options dialog box.
  3. If you know where the macro originated, select Enable This Content.

  4. Click OK.

    The dialog box closes, along with the Security Warning message, and you're free to use the macros in that workbook.

blog comments powered by Disqus
Advertisement

Inside Dummies.com

Dummies.com Sweepstakes

Win $500. Easy.