Join our Newsletter — 33% off our NHI Course
Home› Guides› Office Macros for Beginners: Why Macros Are Blocked…
Guide Attack Techniques & Malware

Office Macros for Beginners: Why Macros Are Blocked and When They Are Dangerous

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 1 December 2026 10 min read
On this page

An Office macro is a small program saved inside a Word, Excel or other Office file to automate tasks.

This guide is for anyone who has seen a warning that macros were blocked and wondered why. You do not need to write macros to be affected: one click on "enable" in the wrong file can let harmful software in.

In short

  • Macros can save time, but criminals also use them to spread harmful software.
  • Microsoft changed Office for Windows, starting in 2022, so macros in files from the internet are blocked by default.
  • Windows tags downloaded files and email attachments with a hidden marker, and Office uses it to decide.
  • If a file you did not expect asks you to turn on macros, delete it or ask your IT team.

What you will learn

  • Explain what a macro is and why it can be risky.
  • Spot the warning signs of a harmful macro file.
  • Describe why Office blocks some macros and not others.
  • Ask your IT team the right questions when you need a macro for work.
Small saved program (macro)
a set of steps stored in a file that Office can run for you.
Internet tag (Mark of the Web)
a hidden label Windows adds to files that came from the internet or email.
Harmful software (malware)
software made to steal, spy, lock files or cause damage.

What is an Office macro?

Think of a recipe card tucked inside a cookbook. Follow it, and the meal gets made without you thinking about each step. A macro is a recipe card for Office: a list of steps it can carry out by itself.

The UK government's cyber security agency describes macros as small programs saved in Office files, often used to automate routine tasks. They are written in a language called VBA (Visual Basic for Applications) [3]. A finance team might use one to tidy a monthly spreadsheet.

Where the comparison stops working: a recipe card cannot reach out of the kitchen. A macro can do far more than tidy a sheet. It can act on your computer much like other software, which is why attackers like it [3].

Why does it matter?

Attackers have used harmful macros since the 1990s. The UK's cyber security agency says they still account for most attacks on Office [3]. Microsoft says they are often used to deliver malware and ransomware. Ransomware is software that locks files until you pay [1].

If you work in an office

What could happen: you open an "invoice" from an email, click to enable content, and harmful software runs.

Check this: did you expect this file, and does it really need macros to be read?

Next: Malicious Attachments for Beginners

If you run a small business

What could happen: one staff member enables a macro, and files across the business are locked.

Check this: ask who sets macro rules on your computers, and whether internet macros are blocked.

Next: Microsoft 365 Security for Beginners

If you are new to IT work

What could happen: a colleague asks you to "just unblock" a file, and the file turns out to be harmful.

Check this: confirm where the file came from before you change any setting.

Next: Malware for Beginners

What does it look like?

Here is a made-up email and the document it carries. It shows the tricks harmful macro files often use.

Example only. All values are made up.

From: [email protected]                       (1)
Subject: URGENT unpaid invoice 0000                   (2)
Attachment: Invoice_0000_FAKE.xlsm                    (3)

[Inside the file]
"This document is protected. To view the content,
click Enable Content above."                         (4)
  1. A sender you do not know, or one that looks like a supplier.
  2. Pressure to act fast about money or an order.
  3. An Excel file that can hold macros. In a real message, this line would show the attachment's name and type.
  4. Text inside the file that tells you to turn on macros to read it.

Why this is risky: Microsoft warns about strangers who push you to enable content. A common excuse is to cancel an order or read a legal paper [2]. You do not need macros just to read or edit a file [2].

The safer way: do not enable anything. Delete the file, or check with the sender by phone using a number you already have.

How does it work?

Office checks where a file came from before it lets macros run. Here are the steps on Windows.

  1. The file is tagged. Windows adds the Mark of the Web to files downloaded from the internet and to email attachments [1].
  2. Office reads the tag. When you open a file that can hold macros, Office checks for the tag [1].
  3. Macros are blocked. If the tag is there, Office shows a Security Risk banner. It has no Enable Content button, unlike the older Security Warning banner [1].
  4. Some places are trusted. Your IT team can set trusted folders, sites or signed macros from trusted publishers, where macros may run [1].
  5. You decide what to do. Microsoft says to unblock a file only if you trust it, and to delete a downloaded file if you are unsure what its macros do [2].
Diagram titled What happens when a downloaded file contains macros. Four boxes in a row joined by arrows. Box 1, File arrives: from email or a website, Windows tags it as internet. Box 2, You open it: Office reads the tag before any macro can run. Box 3, highlighted in green, Office blocks: a Security Risk banner appears, with no Enable button. Box 4, You decide: not expected, delete; needed for work, ask your IT team. A note underneath says files from approved company locations are handled by rules your IT team sets.
Figure 1. How Office on Windows uses the internet tag to block macros.

The default block rolled out from 2022 for Access, Excel, PowerPoint, Visio and Word, with Publisher and Project added later [1]. It applies to Office on Windows. Microsoft says Office on Mac, phones, tablets and the web are not affected by this change [1]. The NCSC notes that older one-off purchase versions, such as Office 2019, do not block internet macros by default [3].

The tag can be lost. For example, Microsoft says files saved on some older storage formats do not get it [1]. That is one reason IT teams set their own macro rules as well.

A worked example

Elif Quist works in the office of a small building firm. On a busy Monday, she gets an email titled "Final notice: unpaid invoice". It comes from a supplier name she half recognises.

She opens the attached spreadsheet. A banner across the top says Microsoft has blocked macros because the file came from an untrusted source. The sheet itself shows only a line of text: "Click Enable Content to view this invoice."

Elif looks for an Enable button. There is none on the banner. She remembers a colleague saying you can unblock a file in its properties. She stops there instead.

Her firm has no invoice due to that supplier this month. And a real invoice should be readable without macros. She rings the supplier using the number in her own contacts. They say they did not send it.

Elif deletes the email and tells the person who looks after the firm's computers. He checks the firm's settings and confirms that internet macros are blocked for everyone, and that staff cannot switch the block off.

Later, the finance team says they need a macro for monthly reports. The IT lead keeps that file in a shared folder that only he can change, and sets it as a trusted location. Nobody needs to unblock files from email any more.

Myths and mistakes

What people thinkWhat is true
I need to enable macros to read a document.Microsoft says reading or editing a document does not need macros.[2]
A file from someone I know is safe.Phishing often copies trusted senders. Check any file you did not expect.[2]
Microsoft blocks every harmful macro now.The default block covers files with the internet tag in Office on Windows. Older versions and files without the tag need other rules.[1][3]
A "click to enable" prompt keeps me safe.The NCSC says prompts are not a reliable safeguard, because people can be tricked into clicking.[3]
Making a whole shared folder trusted is harmless.Macros in a trusted place are not blocked, so control who can save files there.[1]

What can I do this week?

  • Agree with your team that nobody enables macros in files from email or the web.
  • Ask your IT team or supplier whether internet macros are blocked on every computer.
  • List the few spreadsheets that truly need macros, and who owns each one.
  • Check which Office version your computers use, and plan to move off old ones.
  • Tell staff to report odd attachments rather than just delete them.

Checklist

  • I do not enable macros in files I did not expect.
  • I check unexpected files with the sender using contact details I already have.
  • Internet macros are blocked on our computers, and staff cannot switch the block off.
  • Any macros we need are kept in a place only trusted people can change.
  • Our Office versions are still supported and kept up to date.
  • Staff know how to report a suspicious attachment.

Common questions

Why does Office say macros have been blocked?

Because the file came from the internet or an email. Windows tags these files, and Office on Windows blocks their macros by default. Microsoft made this change because macros are often used to deliver malware.[1]

Is it safe to unblock a file?

Only if you are sure where it came from and what its macros do. Microsoft says to delete a downloaded file if you are unsure. At work, ask your IT team rather than unblocking it yourself.[2]

Are macros on a Mac or in a web browser safer?

They are handled differently. The NCSC says Office on the web and on phones does not run macros. Office on a Mac can, and the default internet block described here applies to Windows.[1][3]

Can a macro that is signed still be harmful?

Yes, it can. A signature shows who published it, not that it is safe. The NCSC notes that allowing signed macros lets any validly signed macro run, not just ones you chose.[3]

What can replace macros at work?

The NCSC suggests newer tools that do similar jobs. Examples include Power Automate, Office Scripts, Power Query and newer Excel functions. Replacing macros over time means fewer files that need special rules.[3]

Where next?

Ready for the detail? Read the practitioner guide: Macro Malware Guide. It goes further into macro settings one by one, behaviour-blocking rules, and how to roll out and monitor macro controls.

Also useful:

Related NHI Mgmt Group resources: Secrets in Office Files, Malware for Beginners and Microsoft 365 Security for Beginners.

Key terms

VBA macro
A small program inside an Office file that can run steps when it is allowed to.
Mark of the Web
A hidden Windows label on files from the internet or email that changes how Office treats them.
Macro-laden attachment
An email attachment with macros meant to run harmful code once enabled.
Malware
Software made to steal data, lock files, spy or cause damage.
Ransomware
Malware that locks files or systems and demands payment to unlock them.
Code signing
Adding a digital seal to code so you can check who made it and that it was not changed.

Sources and further reading

  1. Microsoft, "Macros from the internet are blocked by default in Office", Microsoft Learn. https://learn.microsoft.com/en-us/microsoft-365-apps/security/internet-macros-blocked (accessed 1 Dec 2026).
  2. Microsoft, "A potentially dangerous macro has been blocked", Microsoft Support. https://support.microsoft.com/en-us/topic/a-potentially-dangerous-macro-has-been-blocked-0952faa0-37e7-4316-b61d-5b5ed6024216 (accessed 1 Dec 2026).
  3. UK National Cyber Security Centre, "Macro security for Microsoft Office". https://www.ncsc.gov.uk/guidance/macro-security-for-microsoft-office (accessed 1 Dec 2026).

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.