Saving Workbooks that Contain Macros

If you store one or more macros in a workbook, the file must be saved with "macros enabled." In other words, the file must be saved with an XLSM extension rather than the normal XLSX extension.

For example, if you try to save the workbook that contains your NameAndTime macro, the file format in the Save As dialog box defaults to XLSX (a format that cannot contain macros!). Unless you change the file format to XLSM, Excel displays the warning shown in Figure 2-5. You need to click No, and then choose Excel Macro-Enabled Workbook (*.xlsm) from the Save As Type drop-down list.

Figure 2-5:

Excel warns you if your workbook contains macros and you attempt to save it in a non-macro file format.

Microsoft Office Excel

The following features cannot be saved in macro-free workbooks:

To save a file with these featuresj click No, and then choose a macro-enabled file type in the File Type list, To continue saving as a macro-free workbook, click Yes.

0 0

Post a comment