Glossary
Macro malware
Definition
Macro malware: Malicious code hidden in the macros of an Office document, such as a Word or Excel file, that runs when the file is opened and macros are allowed. It usually arrives as an email attachment and downloads other malware such as ransomware or banking trojans.
Also known asmacro virusmalicious macroVBA malwareOffice macro malwaredocument malware
In short
Macro malware is malicious code hidden in the macros of an Office document, usually Word or Excel, that runs once someone opens the file and allows macros. It arrives as an email attachment dressed as an invoice or legal notice, with fake instructions to enable content. Office on Windows blocks macros in files from the internet by default, but unblocked files still run.
Key takeaways
- Macro malware uses Office's automation feature to download ransomware, spyware and other payloads.
- It needs you to enable macros, so the document opens with a fake instruction to do so.
- Office on Windows blocks macros in files from the internet by default and shows a Security Risk banner.
- Macro-enabled files usually end in m, such as .docm or .xlsm, but templates like .dot and .xlt can carry macros too.
- Keep macros off and never unblock a file you didn't expect.
Last reviewed 5 December 2026 by Foxcolab Team
Macro malware is malicious code hidden in the macros of an Office document, usually a Word or Excel file, that runs when someone opens the file and allows macros. Macros are small programs meant to automate routine work. Attackers use them to download ransomware, banking trojans and spyware. Microsoft describes how it travels: macro malware "hides in Microsoft Office files and is delivered as email attachments or inside ZIP files," with names "intended to entice or scare people into opening them," such as invoices, receipts and legal documents.
How the trick works#
Office doesn't simply run macros in a file from an unknown source, so the attacker has to get you to switch them on. The document opens to a blurred page and a notice along the lines of "Protected document: click Enable Content to view." Microsoft says the authors "try to scare users by showing fake warnings when a malicious document is opened." One click runs the macro, which quietly downloads the real payload.
What Microsoft changed#
Because "VBA macros are a common way for malicious actors to gain access to deploy malware and ransomware," Office on Windows blocks macros in files from the internet by default (Microsoft Learn). Windows marks downloads and email attachments as coming from the internet, and Office then shows a "SECURITY RISK" banner with no Enable Content button. The block narrows the route without closing it. It applies to Office on Windows, a file's mark can be removed with Unblock in its Properties, and macros still run in files saved to a trusted location. A document that asks you to unblock it deserves the same suspicion as one that asks you to enable content.
How to spot one#
- Macro-enabled extensions usually end in "m":
.docm,.xlsm,.pptm. Microsoft's list of macro-enabled templates also includes.dotand.xlt, so the "m" isn't a complete test. - The document's only content is an instruction to enable, unblock or "unlock" it.
- It arrived unexpectedly from a "supplier," "court" or "HR."
Microsoft's advice is to keep macros disabled, not open suspicious attachments, and delete mail from unknown senders with suspicious content. See malware and Trojan horse for what the payload does next.
In Foxcolab#
On the web, Foxcolab Mail asks before you download a macro-enabled Office file such as .docm, .xlsm or .pptm. Download this file? explains that files like this "can contain other files or run scripts when opened," and the focus sits on Cancel. When you attach a document that can run macros, Foxcolab Mail checks it on your device and warns: "This document can run macros (small programs inside it). Only send it to people who expect it." To share a spreadsheet or report with people outside your team, a Foxcolab Drive link is the better way: Drive files and file names are end-to-end encrypted (how). Create a free account.
Keep exploring
Related terms
- MalwareMalware is any software or file built to harm a device or steal its data, from viruses and trojans to ransomware and spyware. Most of it still arrives through email attachments and links.
- Trojan horse (malware)A Trojan horse is malware disguised as something useful, like an invoice, an update or a free app. Here's how Trojans get in, what they do, and how to keep them out.
- RansomwareRansomware encrypts your files and demands payment for the key, and most attacks also steal data first. What helps is a copy the attacker can't reach.
- PhishingPhishing is impersonation used to trick people into handing over passwords, approving payments or opening malware. Here's how it works and what actually stops it.
- Drive-by downloadA drive-by download installs malware when you simply visit a compromised web page, with no download button involved. Here's how it works and what actually prevents it.
- Endpoint securityEndpoint security protects the laptops, phones and desktops people use to reach data. Here's what it covers and why it matters more when data is end-to-end encrypted.
Where Foxcolab uses it

Foxcolab
Private work tools, without the ads.
Mail, files, documents, spreadsheets and meetings in one account. Files, documents and spreadsheets are end-to-end encrypted.