Macros are turned on differently depending on which program you use

A macro is a recorded set of actions that runs automatically when you trigger it — usually by clicking a button or pressing a keyboard shortcut. To use a macro someone else created, or to run one you recorded yourself, you need to enable macros in your program first. The steps differ between Microsoft Office (Excel and Word), Google Sheets, and other applications.

Most macros are safe, but they can also carry risk if they come from an untrusted source. When you enable macros, you are telling your program to run code that could theoretically access your files or change your data. This is why programs ask for permission before turning them on — and why you should only enable macros from files you trust.

Key Takeaways

  • Excel and Word require you to enable macros through the Trust Center settings, and the steps are the same in both programs.
  • Google Sheets does not use macros in the traditional sense — it uses Apps Script instead, which you write directly in the editor.
  • When you open a file with macros in Excel or Word, you will see a yellow warning bar asking whether to enable them; clicking "Enable Content" turns them on for that file only.
  • If you record your own macro in Excel, you must save the file as .xlsm (macro-enabled) rather than the default .xlsx format, or the macro will be lost.
  • Permanently enabling all macros in Excel or Word is possible but not recommended unless you work exclusively with trusted files.

Enabling macros in Excel

When you open an Excel file that contains a macro, you will see a yellow bar below the ribbon that says "Security Warning: Macros have been disabled." Click the "Enable Content" button on that bar. The macro will then run when you trigger it — usually by pressing a keyboard shortcut or clicking a button in the spreadsheet.

This one-time click only enables macros for that specific file while it is open. The next time you open the same file, you will see the warning again and need to click "Enable Content" again. If you want to permanently trust a file or folder, you can add it to Excel's trusted locations. Go to File > Options > Trust Center > Trust Center Settings > Trusted Locations. Click Add New Location, browse to the folder where you keep your macro files, and click OK. Any file in that folder will run macros without asking.

If you recorded a macro yourself in Excel, save the file as .xlsm (Excel Macro-Enabled Workbook) instead of the default .xlsx format. To do this, go to File > Save As, click the dropdown that says "Excel Workbook (.xlsx)", select "Excel Macro-Enabled Workbook (.xlsm)", and click Save. If you save as .xlsx, the macro will be deleted.

Enabling macros in Word

Word uses the same process as Excel. When you open a Word document containing a macro, you will see the yellow security warning bar. Click Enable Content to turn on the macro for that document.

Like Excel, this permission applies only to the current session. To permanently trust a folder of Word documents, go to File > Options > Trust Center > Trust Center Settings > Trusted Locations, then add the folder the same way you would in Excel.

If you created a macro in Word, save the file as .docm (Word Macro-Enabled Document) rather than .docx. Go to File > Save As, change the file type dropdown to "Word Macro-Enabled Document (.docm)", and click Save.

Using automation in Google Sheets instead of macros

Google Sheets does not have macros in the traditional sense. Instead, it uses Apps Script, which is Google's scripting language. If someone shares a Google Sheet that includes automation, the script runs automatically — you do not need to enable anything. Google Sheets handles the permissions differently than Excel or Word.

If you want to create your own automation in Google Sheets, open the sheet and go to Extensions > Apps Script. This opens the Apps Script editor in a new tab. You can write code there or use the macro recorder to record actions and convert them to script. Unlike Excel, you write the code directly rather than enabling a pre-recorded macro.

Changing macro security settings permanently

You can change how Excel and Word handle macros globally, though this is not recommended unless you work only with files you trust. In Excel, go to File > Options > Trust Center > Trust Center Settings > Macro Settings. You will see four options:

  • Disable all macros without notification: Macros never run, and you see no warning.
  • Disable all macros with notification: Macros are blocked, but you see the yellow warning bar and can click "Enable Content" if you choose. This is the default setting.
  • Disable all macros except digitally signed macros: Only macros signed by a trusted publisher will run automatically.
  • Enable all macros: All macros run without asking. This is the least secure option.

The default setting — "Disable all macros with notification" — is the right choice for most people. It blocks macros by default but lets you decide on a case-by-case basis whether to trust a file. Change this setting only if you have a specific reason and understand the security trade-off.

What to do if you see a macro warning and are not sure whether to enable it

If you open a file and see the security warning, ask yourself: Did I create this file, or did someone I trust send it to me? If the answer is yes, click "Enable Content." If you are not sure where the file came from or who created it, do not enable macros. Close the file instead.

Macros can do powerful things — they can read your files, send emails, or change data. A malicious macro could theoretically cause real harm. The yellow warning bar exists to give you a moment to think before running code you did not write. Taking that moment seriously is the safest approach.

Frequently Asked Questions

Why does my macro file keep asking me to enable macros every time I open it?

Because you clicked "Enable Content" for that session only. The permission does not carry over to the next time you open the file. To stop seeing the warning, add the file's folder to your trusted locations in the Trust Center, or save the file in a location Excel or Word already trusts by default.

I recorded a macro in Excel but it disappeared when I reopened the file. What happened?

You saved the file as .xlsx instead of .xlsm. Excel deletes macros from standard workbooks to keep file size down. Save as .xlsm (macro-enabled) to keep the macro. If the file is already saved as .xlsx, you can re-record the macro and save it correctly this time.

Can I enable macros for just one user on my computer, or does it affect everyone?

Macro settings in Excel and Word are per-user, not per-computer. If you change the Trust Center settings, they apply only to your user account. Other people who log into the same computer will see their own settings.

Is it safe to enable macros from someone I work with?

Usually yes, but only if you trust that person and you know the file came directly from them. If someone forwards you a file that originally came from someone else, or if you downloaded it from the internet, be more cautious. Malware can spread through macro-enabled files.

What is the difference between a macro and Apps Script in Google Sheets?

A macro in Excel or Word is a recorded sequence of actions that plays back automatically. Apps Script in Google Sheets is actual code you write (or that the recorder generates) that runs on Google's servers. Apps Script is more powerful but requires more technical knowledge to create from scratch.