Excel error 1004: Programmatic access to Visual Basic Project is not trusted

#description#

What?

A lot of our excel reports contain macros. It is possible that your computer shows an error the first time such a report is opened.

The Run-time error '1004': Programmatic access to Visual Basic Project is not trusted is shown because of incorrect settings in Microsoft Excel. This will prohibit the report to generate the correct lay-out and contents.

Image result for error 1004 programmatic access to visual basic project is not trusted

#summary#

How to solve?

  1. Open the Microsoft Excel Options.
  2. Open the Trust Center Settings.
  3. Under Macro Settings, click 'Enable all macros' and 'Trust access to the VBA project model'.
  4. Click 'OK' and close all windows.

How to solve? (extended version)

  1. Open the Microsoft Excel Options.

    E5_-_1.png

  2. Open the Trust Center Settings.

    E5_-_2.png

  3. Under Macro Settings, click 'Enable all macros' and 'Trust access to the VBA project model'.

    E5_-_3.png

  4. Click 'OK' and close all windows. The report can now be opened correctly.