About Macro Security

When working with macros, it is important to be wary of the risks involved with their vulnerabilities. Only run known macros from trustworthy sources.

You have the option to enable and disable macros by default. This protects your work and computer from running dangerous malicious code unexpectedly. Macros are disabled by default when Revit is first installed.

Setting Application-level macro security

  1. Disabling Application-level macros restricts access to both the Run and StepInto tools on the Macro Manager. You will still be able to see, edit, and build the code, but modifications will not change the current module status.

    Click Manage tabMacros panel Macro Security.
  2. Select the Macros tab.
  3. In the Application Macros Security Settings section, select either Enable application macros or Disable application macros. When enabling macros, you will be prompted to verify you want to enable this setting.
  4. Click OK.
  5. Close and reopen Revit.
    Note: Any changes to application-level macro settings will take effect after Revit is restarted. The setting will persist until it is changed.

Setting Document-level macro security

  1. Disabling document-level macros restricts access to both the Run and StepInto tools on the Macro Manager for any project opened inRevit. You will still be able to see, edit, and build the code, but modifications will not change the current module status.

    Click Manage tabMacros panel Macro Security.
  2. Select the Macros tab.
  3. In the Document Macros Security Settings section, select one of the following:
    • Ask before enabling document macros. This is the default setting. Macros are disabled, but you will be prompted to enable them if macros are present when a Revit project is opened. You can then choose to enable macros whenever they are detected.
    • Disable document macros. Disables document-level macros when a project is opened. To enable macros in this state, you must close the project, adjust the Macro Security settings, and reopen the project.
    • Enable document macros. Enables document-level macros when a project is opened. To disable macros in this state, you must close the project, adjust the Macro Security settings, and reopen the project. When enabling macros, you will be prompted to verify you want to enable this setting.
  4. You should avoid the Enable document macros setting if possible. You will not be warned when opening a document about macros and potentially dangerous and malicious code that can run. It is recommended that you use Ask before enabling document macros, if you are not familiar with Revit macros or frequently open projects from unfamiliar sources. The Enable document macros setting should only be used when you know the source of the embedded macros.

    To help you identify the current status of macro security, you are given status icons and notification prompts in the lower right corner of the Revit application frame.
    Document-level Macro Status and Warnings
    Macro Security Setting Status Icon Notification when Opened
    Enable document macros
    Disable document macros
    Ask before enabling document macros User-defined. A warning dialog prompts you to either enable or disable the macros. The resulting answer displays the correct icon. This is the default setting.