Enable for single session

  • Click the File tab > Info.
  • In the Security Warning area, click Enable ContentAdvanced Options.
  • In the Microsoft Office Security Options dialog box, select Enable content for this session, and click OK.

Enable macros for the current session.

This turns on macros for one time. When you close the workbook, and then reopen it, the warning will appear again.

Enable macros in all workbooks via Trust Center

Microsoft Excel determines whether to allow or disallow VBA codes to run based on the macro setting selected in the Trust Center, which is the place where you configure all the security settings for Excel.
To get macros enabled in all Excel workbooks by default, this is what you need to do:

  • Go to the File tab > Options.
  • On the left-side pane, select Trust Center, and then click Trust Center Settings… .

Trust Center Settings

  • In the Trust Center dialog box, click Macro Settings on the left, select Enable all macros and click OK.

Enable all macros in Excel by default.

Notes:
  • The option you set via the Trust Center becomes the new default macro setting and applies globally to all of your Excel files. If you want to enable macros for only specific workbooks, save them in a trusted location instead.
  • Enabling all macros in all workbooks makes your computer vulnerable to potentially dangerous codes.