CrukMilk Media

How to Activate Macros in Excel One Workbook at a Time

Activating macros in Excel is a decision about one file. Right-click the workbook in File Explorer, choose Properties, tick Unblock at the bottom of the General tab, and select OK; that clears the Mark of the Web behind the red SECURITY RISK banner reading "Microsoft has blocked macros from running because the source of the file is untrusted." Reopen the workbook and click Enable Content on the yellow SECURITY WARNING bar if one appears, which trusts that single document. Leave File > Options > Trust Center > Macro Settings on its default, "Disable VBA macros with notification." The file must also be saved in a format that holds code: Microsoft's file-format reference states that .xlsx "cannot store Microsoft Visual Basic for Applications (VBA) macro code," while .xlsm stores it.

The phrasing of the question is worth pulling apart first. How to activate macros in Excel sounds like Excel owns a macro switch the way a lamp does, and that flipping it is what makes the button on your sheet work. Excel does have settings. It also keeps separate trust records for individual files, folders, and signing certificates, and those records are evaluated ahead of the settings. Nearly everyone arriving here needs one file-level record changed. The application-wide setting is the one thing to leave alone.

Excel shows two different macro warnings, and they mean different things

The yellow SECURITY WARNING bar with an Enable Content button means the workbook holds a VBA project and Excel has disabled it, pending your decision. Clicking Enable Content converts the file into what Microsoft calls a trusted document — "files that have been marked as trusted by enabling active content in them" — and the bar will not return when you reopen it.

The red SECURITY RISK banner with no Enable Content button is a different mechanism. Windows attached a Mark of the Web to the file because it arrived from the internet or the Restricted sites zone, and Office blocks macros in those files by default. Microsoft's Macros from the internet are blocked by default in Office reproduces both the banner and the sentence. There is no button because no per-document choice is on offer.

Neither bar tells you the file is safe. The yellow one reports that code exists; it does not authenticate the author or inspect the code's intent. Microsoft's trusted-documents page puts it flatly: "Never enable content in a document if you're not sure what that macro does."

At the audio-guide complaint desk where I started, the most common written complaint was one word: broken. The handsets logged fine almost every time. What had failed was the induction loop switch on the side of the unit, which announced nothing at all. A prompt confirming that a condition exists is a different instrument from one that tells you what is wrong, and Excel's yellow bar is the first kind.

Identify the workbook before you change any setting

Write down five things. Each has a source on your own machine — the only place these figures exist.

How many workbooks actually need macros

Count them from your recent-files list. One or two, and everything below applies. Nine, and you are running an undocumented deployment rather than troubleshooting a file; the conversation to have is with IT, about a signing certificate or one managed folder. Nobody has surveyed your file list but you.

The file extension

Turn on View > Show > File name extensions in File Explorer rather than trusting the icon. Microsoft's File formats that are supported in Excel is unambiguous: .xlsx "cannot store" VBA macro code or Excel 4.0 macro sheets, .xlsm "stores VBA macro code," and .xltm does the same for templates. If a colleague saved a macro workbook as .xlsx, the code was discarded at save time, and no Trust Center setting recovers it. Ask for the original.

Whether a VBA project is actually there

Press Alt+F11 to open the Visual Basic Editor and look at the Project Explorer. Both .xlsm and .xlsb can carry code, and either can be empty of it: the extension tells you what a file is permitted to hold. An empty Project Explorer means there is nothing to enable.

Whether the file carries Mark of the Web

At a command prompt, run `notepad "yourfile.xlsm":Zone.Identifier`. Microsoft lists five ZoneId values: 0 for My Computer, 1 for Local intranet, 2 for Trusted sites, 3 for Internet, 4 for Restricted sites. ZoneId 3 is blocked by default; ZoneId 2 is not. The mark exists only on NTFS, so a file that traveled on an old FAT32 stick arrives with its warning stripped and its provenance gone together.

Your Office build

File > Account > About Excel gives the version and build. Microsoft's update history lists Current Channel at Version 2608 (Build 20326.20132), released 1 September 2026. Internet-macro blocking reached Current Channel in Version 2206 on 27 July 2022, the line separating the two banner behaviors above.

Pick the narrowest permission that solves your case

| Method | What it grants | Lasts | Undo | |---|---|---|---| | Unblock the file in Properties | Removes Mark of the Web from one file | Until re-downloaded | Delete the copy | | Enable Content on the yellow bar | One document you have inspected | Indefinitely, per file, per app | Trusted Documents > Clear | | Trust the publisher's certificate | Every macro signed with that certificate | Until removed from Windows | Remove from Trusted Publishers | | Add a trusted location | Every Office file placed in that folder | Until the folder is removed | Trusted Locations > Remove | | Change Macro Settings to enable all | Every macro in every workbook you open | Until you change it back | Reset to the default setting |

A trusted location is the convenience fix handed out most often, and it deserves the hardest look. Excel ships with six default trusted locations — application templates, user templates, Excel startup, user startup, Office startup, add-ins — of which four extend to subfolders, per Microsoft's Trusted Locations for Office files, and Group Policy adds twenty numbered slots for administrators. Files opened from any of them "bypass threat protection services, bypass file block settings, and all active content is enabled," skipping Protected View as well. Count your own list under Trust Center Settings > Trusted Locations: anything past the six defaults was added by you or by policy. Enabling one reviewed document trusts one file you have read. Adding a folder trusts every file anyone with write access puts there afterward, which is why Microsoft says trusted locations "should be used rarely, for unique situations and only for select users."

Digital signatures sit above both in the evaluation order: if a macro is signed and your device holds the matching trusted publisher certificate, the workbook opens with macros running, ahead of the policy check. Read the issuer, subject and expiry date in the signature dialog first. Publicly trusted code signing certificates issued on or after 1 March 2026 are capped at 460 days under the CA/Browser Forum's code signing baseline requirements, down from 39 months, so one claiming several remaining years predates that rule. A certificate made with SelfCert is trusted only where it has been imported into the Trusted Root store, as Microsoft's Digitally sign your VBA macro project explains.

I spent years correcting caption files where the speaker's name was right and the words under it were wrong. A signature is the name. Microsoft warns that all macros validly signed with the same certificate are recognized as coming from a trusted publisher and are run, and that adding one is a Windows-wide setting rather than an Office-specific one. Valid tells you who signed, never that the code belongs in your finance workbook.

Why switching Excel to enable all macros is the wrong repair

The fastest advice you will find is to open Macro Settings and pick the fourth option, "Enable VBA macros (not recommended; potentially dangerous code can run)." It survives because it works within seconds.

Three things are wrong with it. The setting is application-wide, so it changes how every workbook you open behaves from then on, including the next attachment. It has no expiry and leaves no record of why it changed, so the next person to look — you, in March — finds a machine in an unexplained state. And it frequently fails to fix the case that prompted it: Mark of the Web is evaluated first, so a file carrying ZoneId 3 stays blocked behind the red banner while the macro setting cheerfully reads Enable.

Microsoft grades the four options directly. "Disable VBA macros except digitally signed macros" and "Disable VBA macros without notification" are rated protected, the default is rated partially protected, and enabling all macros is rated not protected.

The complaint-desk version of this move was turning a handset to maximum volume. It satisfied the person at the counter and did nothing for the visitor whose hearing aid needed the loop switched on. Turn it up is rarely a complete plan. If the setting has already been changed, put it back to "Disable VBA macros with notification."

When the button does nothing and no warning appears

An absent warning bar is not evidence that macros are running. Work through these in order.

  1. You already trusted this file. Enable Content is permanent per document, so a file approved in June opens silently in September. Check Trust Center > Trusted Documents.
  2. The file sits in a trusted location, which bypasses the prompt by design.
  3. Policy disabled macros without notification. Nothing appears and nothing runs; Microsoft's trusted-documents page names this case, because a file cannot become a trusted document under that policy.
  4. The workbook is .xlsx, so there is no code to run.
  5. The shape is wired to nothing. Right-click the button, choose Assign Macro, and check that a procedure name is selected. Renaming a procedure breaks the link without an error.
  6. The macro runs and fails. Press Alt+F11, run it again, and when execution halts the editor highlights the failing statement while the dialog gives an error number, such as run-time error '1004'. Record both numbers.

That pair is worth insisting on. "The button doesn't work" is not a report anyone can act on. An error number and a line number, read off the Visual Basic Editor, let the macro's author answer in one message.

When the block belongs to your organization

Managed work and school devices override local choices, and the signs are specific: the Trust Center radio buttons are grayed out, the message reads "Your administrator has restricted the use of macros in your organization," or the Unblock checkbox is missing from a network-share file's Properties dialog.

Microsoft documents a separate macro policy for each of seven applications, and Excel's is named Macro Notification Settings where the other six are VBA Macro Notification Settings — which is why searching for the Word policy name finds nothing under Excel. These policies exist only with Microsoft 365 Apps for enterprise, not for business.

The network-share case has its own trap. Microsoft notes that users often see no Unblock checkbox for files on a share, and that ticking it has no effect when the share counts as being in the Internet zone. That is a zone-assignment problem belonging to whoever manages the Site to Zone Assignment List, and no Trust Center adjustment touches it. Send your administrator the file path, extension, ZoneId, the banner text, your Office build, and the error and line numbers.

Excel for the web is a hard limit rather than a policy. A macro-enabled workbook opens in the browser with its code intact, and Microsoft's browser-versus-desktop comparison states that macros do not run in a browser window; the Office Scripts platform table lists VBA as unsupported there. Office Scripts needs an enterprise or educational license and reaches only the workbook, whereas VBA macros "have the same security clearance as Excel," with full access to your desktop. A macro moved to the web has to be rebuilt.

Run the macro, then take the trust back

Finish the task, then reverse what you opened. Trust records in Excel have no expiry.

Clear them at Trust Center Settings > Trusted Documents, using the Clear button beside "Clear all Trusted Documents so that they are no longer trusted." That resets every Enable Content decision you have made in Excel, and it runs separately in Word and PowerPoint. Remove any trusted location added for a one-off job. For a workbook arriving from an outside sender every month, the Disable Trusted Documents checkbox on the same page fits better: the Security Warning returns each time, and macros are enabled for that session only.

I cleared my own list the morning the leaves came down, expecting four entries and finding more than a dozen. One belonged to a sender whose contract ended two summers ago, and Excel had gone on opening his workbook without a word. The Trusted Documents list has no expiry column, and Excel will never prompt you to review it.

Questions people ask about enabling Excel macros

Why are my macros not working in Excel?

Check five causes in order: the workbook is saved as .xlsx, which cannot hold VBA code; the file still carries Mark of the Web and shows the red SECURITY RISK banner; an administrator policy disables macros silently; the button has no macro assigned; or the macro runs and fails at a line shown in the Visual Basic Editor.

Why are macros disabled in Excel?

VBA code runs with the same access to your computer that Excel itself has, so Excel disables it by default. The Trust Center default, "Disable VBA macros with notification," blocks the code and shows a yellow bar so you decide file by file. Files from the internet are blocked outright.

How do I activate a macro button in Excel?

Enable the workbook's macros first: unblock the file in Properties, then click Enable Content when you reopen it. If the button still does nothing, the shape may have no macro attached. Right-click it, choose Assign Macro, and select the procedure name. A renamed or deleted procedure breaks the link silently.

How do I enable macros in Excel 365?

The path matches other desktop versions. Right-click the file, open Properties, tick Unblock, then click Enable Content on the yellow bar when you reopen the workbook. Confirm your build under File > Account; Current Channel is at Version 2608. Leave File > Options > Trust Center > Macro Settings on its default setting.

Why has Microsoft blocked macros because the source is untrusted?

Windows attaches a Mark of the Web to files from the internet or email, and since Current Channel Version 2206 in July 2022, Office blocks macros in those files by default on Windows. Confirm the sender first, remove the mark through the file's Properties dialog, then reopen the workbook and the macros run.

Can Excel for the web run this VBA macro?

No. A macro-enabled workbook opens in the browser and the code stays inside the file, but Microsoft states that macros do not run in a browser window. Open the workbook in desktop Excel on Windows or Mac instead. The browser-side alternative is Office Scripts, which needs an enterprise or educational license.

Sien Rosenblatt
The publicationContactPrivacy notice
© CrukMilk Media