Skip to content

What Is an Excel Macro?

An Excel macro is a small program inside a spreadsheet file. Learn why scammers hide harmful instructions in macros and why you should not click Enable Content.

Text and Email ScamsUpdated November 10, 20263 min read

An Excel macro is a small computer program stored inside a Microsoft Excel spreadsheet. In business, people use macros to do repetitive chores automatically, like adding up columns or formatting a page with one click.

Because a macro is a program that follows instructions, criminals also use them. A scammer can write a macro that tells your computer to download harmful software or steal your passwords. They hide this macro inside an ordinary-looking spreadsheet and send it to you by email.

How scammers use macros

Criminals often attach macro files to phishing emails. The email usually tries to rush or worry you. It may claim you have an overdue bill, a tax problem, or an unexpected invoice attachment.

When you open the attached spreadsheet, Microsoft Excel protects you by blocking the macro at first. You will see a yellow or red warning bar near the top of the screen with a button that says Enable Editing or Enable Content.

The scammer cannot harm your computer while that block is in place. To get around it, they write a message directly on the spreadsheet page. It often says the document is protected or scrambled, and tells you to click Enable Content so you can read it. That message is a trick.

File name: Invoice_4471.xlsm - Excel

SECURITY WARNINGMacros have been disabled.

Enable Content

This document is protected

This file was made in an older version of Excel. To view it, click the button in the yellow bar above.

Red flags in this file

How a macro scam works
  1. The scammer sends an urgent email

    The email claims to be a bill, receipt, or shipping notice with an Excel file attached.

  2. Excel blocks the hidden program

    When you open the file, Excel stops the macro from running and shows an Enable Content button.

  3. The page asks you to click the button

    The spreadsheet looks blurry or blank, with instructions telling you to click Enable Content to view it.

  4. The macro runs in the background

    If you click the button, the hidden program quietly connects to the internet to install harmful software.

If you click that button, the hidden program runs. It can quietly install an infostealer that copies your saved passwords, or ransomware that locks your files.

How to spot a file with a macro

You can often spot a macro file by looking at the letters at the very end of its file name, called the file extension.

  • .xlsx is a standard modern Excel file. It cannot hold a macro.

  • .xlsm is an Excel file built to hold a macro1. The “m” at the end stands for macro.

  • .xls is an older style of Excel file that can also hold macros.

Unless you work in an office that uses custom spreadsheets every day, nobody needs to send you a file ending in .xlsm. A real store, bank, or doctor’s office will send bills and receipts as regular text in an email or as a PDF document, not an Excel file.

What to do if you receive one

  1. Close the file right away. If you opened an unexpected Excel attachment and see an Enable Editing or Enable Content button, do not click it. Close the window. As long as you did not click those buttons, the macro did not run2.

  2. Delete the email. Put the email in your trash folder so you do not open the attachment again by mistake.

  3. Check with the sender the safe way. If the email claims to be from a company you use, call them using the phone number on your paper statement or the back of your card. Never use the phone number or reply address in the suspicious email.

Common questions

Can I check what a macro does without running it?

No. Criminals hide their instructions inside hidden sheets or use white text on a white background so you cannot see them. Do not open a suspicious file to look around. Delete it instead.

What if a file I trust asks me to enable macros?

Microsoft blocks macros by default in any file sent over the internet. If a trusted coworker or accountant told you ahead of time that they are sending a macro-enabled spreadsheet, call them on the phone first to make sure the email really came from them before you unblock it.

For more information

  1. Protect yourself from macro virusessupport.microsoft.com
  2. VBA malware in Excel - Microsoft Q&Alearn.microsoft.com

Keep reading

More in Text and Email Scams

What Is Phishing?

Phishing is a scam where someone sends a fake message to steal your passwords, account numbers, or money. Learn what it looks like and how to handle it.

DefinitionText and Email Scams