Excel Macro Blocked? How to Unblock It Safely

VBA & macros · Updated November 11, 2026

If Excel says a macro is blocked, first check where the workbook came from; Microsoft 365 for Windows blocks VBA macros in many files marked as downloaded from the internet. If you trust the source and have verified the file, close Excel, use File Explorer to right-click the workbook, choose Properties, select Unblock if it appears, and reopen the file. Do not enable macros from an unknown sender just to make a button work.

What the blocked-macro message means

Excel macros are small programs, usually written in Visual Basic for Applications (VBA), that can automate tasks such as formatting reports, updating data, or creating worksheets. Because VBA can also change files, access data, or perform other actions, a macro can be used to deliver malicious code. A workbook that contains VBA is not necessarily dangerous, but its source and contents matter.

On Windows, Microsoft 365 blocks VBA macros in Office files that carry a Mark of the Web, a security label Windows can attach to files downloaded from the internet or received from some online sources. A common warning says that Microsoft has blocked macros from running because the source of the file is untrusted. This is a security decision, not proof that the macro is malicious and not necessarily a fault in the workbook.

Other messages can point to different issues. Excel may show a security warning with an Enable Content button, report that macros are disabled by your administrator, or show no macro at all. The exact message and the file’s origin help determine whether you need to unblock a file, ask an administrator, enable a trusted signed macro, or investigate a workbook that does not contain VBA.

Unblock a trusted workbook on Windows

Use this procedure only when you expected the file and trust the person or organization that provided it. Unblocking removes the internet-origin mark from that file; it does not inspect the VBA or certify that the workbook is safe.

  1. Save the workbook locally and close it in Excel. If it arrived in an email or chat, confirm with the sender that they intended to send a macro-enabled file.
  2. Open File Explorer, find the workbook, and right-click it. Choose Properties. In Windows 11, you may need to choose Show more options before Properties.
  3. On the General tab, look near the bottom for a Security notice and an Unblock checkbox. Select Unblock, choose Apply, and then choose OK. If there is no checkbox, Windows may not have marked that file as downloaded, or another policy may be responsible.
  4. Open the workbook again in Excel. Read any remaining security prompt before choosing whether to enable content.

If the workbook is inside a downloaded ZIP archive, the mark may be associated with the archive or with extracted files, depending on how it was downloaded and extracted. Check the workbook itself in Properties after extraction. Do not assume that removing a warning from the ZIP proves the workbook’s macro code is safe.

Unblock only the particular file you trust. Avoid moving it into a Trusted Location simply to bypass the warning: files in those folders can receive broader trust, and an overly broad folder can expose other workbooks to the same risk.

Why macros are blocked and how Excel security works

Microsoft introduced the internet-macro blocking behavior to reduce the risk of someone persuading a person to open a document and run harmful code. The Mark of the Web is a Windows file-origin marker; it is distinct from the workbook’s VBA project and from Excel’s ordinary macro notification setting. A document can therefore be blocked because of its origin even if Excel’s general macro setting would otherwise allow a prompt.

Excel also has macro settings in the Trust Center. In Microsoft 365 for Windows, open File > Options > Trust Center > Trust Center Settings > Macro Settings. Depending on your organization’s policies and Excel version, options include disabling VBA macros with notification, allowing only digitally signed macros, or enabling VBA macros. The exact options may be locked by an administrator.

Changing the general setting to enable all macros is a poor fix for one blocked workbook. It can allow macros from other files to run too, increasing exposure to malicious attachments and downloads. Likewise, clicking Enable Content is a decision to trust the workbook’s code, not a routine step required for every spreadsheet. If you do not recognize the sender, cannot verify the file, or were not expecting a macro-enabled workbook, leave macros disabled and ask the sender for a clean copy or an explanation.

Check the file type and whether it contains VBA

Look at the workbook’s extension in File Explorer or Excel’s title bar. Macro-enabled Excel workbooks commonly use .xlsm; Excel binary workbooks can use .xlsb; add-ins often use .xlam; and older Excel files may use .xls. The standard .xlsx format cannot store VBA macros. If someone saves a macro-enabled workbook as .xlsx, Excel warns that VBA content cannot be retained; keeping the macro requires saving in a macro-enabled format.

An extension alone does not establish that a file is safe, and a file may have no useful macro even if it uses a macro-capable format. If the expected macro is missing, ask the sender whether they sent the correct version and whether the workbook was saved as .xlsx by mistake. Do not rename an extension as a workaround: changing the name does not convert the workbook or restore VBA that was discarded.

Another possibility is that the workbook uses an Excel feature other than VBA. Formulas, Power Query, and Office Scripts are not VBA macros, although they can also involve automation. Confirm what the file is meant to do before changing security settings.

Other reasons a macro may not run

If unblocking does not resolve the issue, identify the exact warning and check these common causes before changing broad security settings:

  • Organization policy: A work or school administrator may prevent macros, block files from particular locations, or require signed code. If a setting is unavailable or the warning says your administrator blocked it, contact IT rather than trying to override the policy.
  • Protected View: A file may open in Protected View because Excel considers it potentially unsafe. Protected View and macro blocking are related security protections, but they are not the same setting. Do not choose Enable Editing or Enable Content unless you have verified the file and understand the request.
  • Wrong file or format: The sender may have supplied a macro-free copy, or the workbook may have been saved as .xlsx. Ask for the intended macro-enabled version rather than renaming the file.
  • Missing macro or button assignment: A button may refer to a macro that was removed, renamed, or stored in another workbook. That is different from a security block; the workbook’s owner may need to repair the button or provide instructions.
  • File location or sharing service: Email gateways, browser downloads, cloud storage, and network shares can affect how Windows or an organization labels a file. If the same trusted file is blocked again after downloading, ask IT how approved files should be handled instead of repeatedly changing settings.

Use the message as a clue. A specific notice about an untrusted source points toward the file-origin mark. A disabled Trust Center control points toward policy. A missing macro error or a button that does nothing may indicate a workbook design issue instead of a security setting.

Trusted publishers, trusted locations, and safer choices

For recurring business automation, a digitally signed macro from a verified publisher can be a more controlled approach than enabling every macro. A VBA signature helps identify the publisher and whether signed code has changed since signing. It does not guarantee that the code is harmless, so verify the publisher through a separate trusted channel. If a signed project is edited, its signature may no longer be valid.

Trusted Locations are folders Excel treats as trusted for certain security checks. They are useful in carefully managed environments, but placing a file in one is not a malware scan. Do not trust a whole Downloads folder, a shared folder that many people can write to, or a location whose contents you cannot control. For a single downloaded workbook, unblocking that specific verified file is usually a narrower action.

For files used repeatedly at work, ask the organization’s IT or security team for its approved method. Administrators can manage macro policies and signing requirements centrally. A user should not try to defeat those controls by changing registry settings, moving files to unexpected folders, or turning off protections globally.

Excel for Mac and Excel for the web

The Windows Unblock procedure uses Windows file properties and does not apply in the same way on a Mac. Excel for Mac has macro security preferences, commonly found under Excel > Preferences > Security; menu wording can vary with the release. Review the publisher and source before allowing macros, and follow any organization policy. Do not assume that a workbook trusted on one computer is safe on another.

Excel for the web can open many macro-enabled workbooks, but it cannot run or edit VBA macros. Opening the file in a browser will not make its VBA automation work. To use VBA, open the workbook in a supported desktop version of Excel, subject to that device’s security settings. Excel for the web has other automation options, such as Office Scripts in eligible Microsoft 365 accounts, but they are not a way to run the workbook’s existing VBA code.

Safer alternatives to a VBA macro

If the task is simple, a macro may not be necessary. Excel formulas, built-in formatting, tables, and Power Query can handle many repeatable spreadsheet jobs without running VBA. For example, use a table to keep new rows included in a dataset, conditional formatting to flag values, or Power Query to import and reshape recurring files. These options still deserve care when data comes from an untrusted source, but they avoid enabling a VBA project merely to perform routine worksheet work.

For new automation in Microsoft 365, Office Scripts may suit tasks that run in Excel for the web or integrate with supported workflows. Availability depends on the account, administrator settings, and the task. If a workbook depends on existing VBA, an alternative will not automatically reproduce its behavior; document what the macro does and assess whether it can be replaced before removing it.

Before running any macro, save a separate copy of the workbook. Excel cannot undo a macro’s actions with Ctrl+Z, and a macro may change or delete data in ways that are difficult to reverse. A backup is especially important when the workbook contains business records or the macro affects multiple sheets or files.

Frequently Asked Questions

How do I unblock an Excel macro that Windows blocked?
Close Excel, right-click the trusted workbook in File Explorer, choose Properties, select Unblock on the General tab if available, and apply the change. Reopen the workbook and review any remaining prompt.

Is it safe to click Enable Content in Excel?
Only when you trust the source and have a good reason to run the code. The prompt does not confirm that a macro is safe. If the file was unexpected or the sender cannot verify it, keep macros disabled.

Why is the Unblock checkbox missing?
The file may not have a Windows internet-origin mark, or a different Excel or organization policy may be blocking it. Check the exact warning and contact your administrator if the workbook is managed by work or school.

Can Excel for the web run VBA macros?
No. Excel for the web can open many macro-enabled workbooks, but it does not run or edit their VBA. Use desktop Excel if the macro is required and the file is trusted.

Will saving as .xlsx fix a blocked macro?
No. The .xlsx format does not store VBA, so saving in that format removes the macro content rather than safely unblocking it. Keep a backup and use a macro-enabled format only when the VBA is genuinely needed.

Related

Try it: the Column Letter to Number: aA is 27, XFD is 16,384. Converts both ways.

More in VBA & macros

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.