What is the file extension for an Excel workbook containing a BA program?

The Correct Answer and Explanation is:

Correct Answer: b. .xlsm


Explanation:

An Excel workbook that contains a VBA (Visual Basic for Applications) program is saved with the .xlsm file extension. This format supports macros, which are sequences of instructions written using the VBA language to automate tasks in Excel.

When you create and save a regular Excel workbook without macros or VBA code, Excel uses the .xlsx file extension. However, .xlsx files do not support macros. If you try to add VBA code to a workbook and save it as .xlsx, Excel will alert you that the code will be lost unless you use a different format.

The .xlsm format is specifically designed for macro-enabled workbooks. It retains all the features of an Excel workbook, such as multiple worksheets, formulas, charts, and formatting, while also allowing the use of embedded code for automation.

This file type was introduced in Excel 2007, along with the XML-based file formats (.xlsx, .xlsb, .xltx, .xltm). The “m” in .xlsm stands for macro-enabled, distinguishing it from macro-free formats like .xlsx.

For example, if you create a macro that automatically sorts data when a button is clicked, you must save the workbook as .xlsm for the macro to be saved and executed properly. If saved in any other format that does not support macros, the VBA code will be removed.

To summarize:

  • Use .xlsm when your Excel workbook contains macros or VBA programs.
  • Always ensure macro security settings are correctly configured to allow trusted code execution.
  • Remember that enabling macros in a downloaded .xlsm file can carry security risks if the source is unknown.

Hence, the correct extension for an Excel workbook with a VBA program is .xlsm.

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *