What macros are and why they're usually turned off

A macro is a recorded set of actions that runs automatically when you trigger it — usually a keyboard shortcut or a button click. In Microsoft Word or Excel, a macro might format a document, fill in repeated information, or run calculations across hundreds of rows. In Google Sheets, macros automate tasks like sorting data or sending emails to a list.

Macros are turned off by default in most programs because they can be weaponized. A malicious macro embedded in a document you read can install malware, steal passwords, or lock your files for ransom. This is not theoretical: macro-based attacks have been used in real ransomware campaigns and corporate breaches. The programs you use have decided that the risk of an accidental macro infection is worse than the inconvenience of having to turn them on manually when you need them.

Before you enable macros, ask yourself: Did I create this macro myself, or did someone I trust send me a document containing one? If the answer is no, do not enable macros in that document. If the answer is yes, the steps below show you how.

Key Takeaways

  • Macros are disabled by default because they can carry malware, so only enable them in documents you created or received from someone you trust.
  • In Microsoft Word and Excel, you enable macros by changing the Trust Center settings or by saving the file as a macro-enabled format (.xlsm or .docm).
  • In Google Sheets, you create and run macros through the Extensions menu, and they are enabled by default for your own sheets.
  • If someone sends you a document with macros disabled, ask them to explain what the macro does before you turn it on.

Enabling macros in Microsoft Word

When you open a Word document containing a macro, you will see a yellow security bar below the ribbon that says "Security Warning: Macros have been disabled." Click the "Enable Content" button on that bar to turn on the macros in that document only.

If you want to enable macros permanently for documents from a specific person or folder, open Word and go to File > Options > Trust Center > Trust Center Settings > Trusted Locations. Add the folder where you store trusted documents. Any macro in a document from that folder will run without the warning. This is useful if you work with a colleague who sends you templates with macros, but use it sparingly — only for folders you control.

If the security bar does not appear, the document may have been saved in a format that does not support macros (.docx). Macro-enabled Word documents end in .docm. Ask the person who sent it to you to resave it in that format.

Enabling macros in Microsoft Excel

Excel works the same way as Word. Open a spreadsheet with macros, and you will see the yellow security bar. Click "Enable Content" to run the macros in that file.

If you are creating your own macro in Excel, you must save the file as .xlsm (macro-enabled) rather than .xlsx (standard). Go to File > Save As, choose the location, type a filename, and in the "Save as type" dropdown, select "Excel Macro-Enabled Workbook (.xlsm)". If you save it as .xlsx, the macro will be stripped out.

You can also record a macro without writing code. Go to View > Macros > Record Macro, give it a name and a keyboard shortcut, then perform the actions you want to repeat. Click Stop Recording when you are done. The next time you press that shortcut, Excel will replay those exact steps. This is useful for repetitive formatting or data entry tasks.

Enabling macros in Google Sheets

Google Sheets handles macros differently than Microsoft Office. You create and manage them through the Extensions menu rather than through a security prompt. Go to Extensions > Apps Script, and you can write or paste macro code directly into the editor. When you save the script, it is tied to that sheet and runs only when you trigger it.

Unlike Word and Excel, Google Sheets does not disable macros by default in documents you receive. If someone shares a sheet with you that contains a macro, the macro will run when triggered unless you explicitly remove it. Before you open a shared sheet, ask the person who sent it what the macro does. If you do not recognize the macro or do not trust the source, do not click any buttons or run any scripts in that sheet.

To see what macros are in a sheet you received, go to Extensions > Apps Script. The code will be visible in the editor. If you do not understand what it does, do not run it. You can also delete the entire script by clicking the trash icon next to the filename in the left panel.

When to say no to macros

If someone sends you a document with macros and you do not know them well, or if they cannot explain what the macro does, do not enable it. This is not rude — it is basic security. Legitimate macro creators expect this question and can answer it in one sentence.

Watch for these red flags: the sender is vague about what the macro does, they pressure you to enable it when ready, the document came from an email that looks slightly off (a misspelled domain, an unusual sender address), or you were not expecting the document at all. Any of these is a reason to ask the sender to resend it or to delete it.

If you receive a macro-enabled document from your bank, your government agency, or your employer's IT department, contact them directly using a phone number or email address you know is real. Do not use contact information from the document itself. Criminals sometimes impersonate official sources to trick people into enabling malware.

Disabling macros again

If you enabled macros in a document and later want to turn them off, the process depends on which program you use. In Word and Excel, go to File > Options > Trust Center > Trust Center Settings > Macro Settings, and select "Disable all macros without notification". This will block all macros in all documents unless you explicitly enable them each time.

In Google Sheets, go to Extensions > Apps Script and delete the script. There is no global setting to disable macros — you manage them per sheet.

If you added a folder to your Trusted Locations in Word, you can remove it the same way: File > Options > Trust Center > Trust Center Settings > Trusted Locations. Select the folder and click Remove.

Frequently Asked Questions

What happens if I enable a macro by accident?

If the macro was malicious, it may have already run. Disconnect your computer from the internet when ready, run a full antivirus scan using Windows Defender or a third-party tool like Malwarebytes, and change your passwords from a different device. If you are on a work computer, tell your IT department right away.

Can I see what a macro does before I enable it?

In Word and Excel, not easily — the macro code is hidden unless you open the Visual Basic editor (Alt + F11), which requires some technical knowledge. In Google Sheets, you can see the code by going to Extensions > Apps Script. Ask the person who created the macro to explain it in plain language before you enable it.

Do I need to enable macros every time I open a document?

No. Once you click "Enable Content" in Word or Excel, the macros stay enabled for that document. If you close and reopen it, you will see the security bar again, but the macros will run once you click Enable. If you add the document's folder to your Trusted Locations, the security bar will not appear at all.

Is it safe to enable macros from my company?

Usually yes, if your company's IT department created or approved the macro. But verify by contacting your IT department directly — do not use contact information from the document itself. Criminals sometimes send fake internal documents with malicious macros.

What if a document says macros are required to work?

Be skeptical. Legitimate documents usually work without macros — the macro just automates something that could be done manually. If someone tells you a document will not work without macros enabled, ask them to explain why and to walk you through what the macro does. If they refuse or cannot explain it clearly, do not enable it.