Applies ToExcel for Microsoft 365 Excel 2024 Excel 2021 Excel 2019 Excel 2016 Excel 2013

Although Microsoft Excel still supports Excel 4.0 (XLM) macros, we encourage you to migrate them to the latest version of Microsoft Visual Basic for Applications (VBA). Migrating your macros lets you take advantage of the improvements to the VBA programming object model. To make this easier for you, some new objects, methods, and properties have been added to the object model for the few remaining functions that did not have equivalents in earlier versions of VBA. In addition, performance improvements for Page Setup operations in VBA have been added to provide similar performance to PAGE.SETUP() functionality in XLM macros.

If you decide you’re not ready to migrate, you can still run Excel 4.0 macros. When you open an XLM macro in Excel with macros disabled, Excel displays the following message:

"Because of your security settings, macros have been disabled. To run macros, you need to reopen this workbook, and then choose to enable macros. For more information about enabling macros, click Help."

To change macro settings to allow you to run XLM macros, do the following:

  1. Click the File tab, and then click Options.

  2. Click Trust Center, and then click Trust Center Settings.

  3. Click Macro Settings, and then select the Enable Excel 4.0 macros when VBA macros are enabled check box. You can then select Disable VBA macros with notification or Enable all macros (not recommended; potentially dangerous code can run)

    Important: We recommend that you do not use the setting Enable all macros (not recommended; potentially dangerous code can run) or that if you do, that you return your macro security setting back to Disable VBA macros with notification or Disable VBA macros without notification as soon as possible.

  4. Click File Block Settings and then, under File Type, select Excel 4 MacroSheets and make sure that the check box for Open is selected.

  5. Under Open behavior for selected file types, click Open selected file types in Protected View and allow editing.

  6. Click OK twice.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in Communities.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.