Where to find the macro settings in each program
Macros are small programs that automate repetitive tasks in Microsoft Office and Google Docs. By default, most of these programs block macros to protect you from malicious code. To use a macro someone has written for you, you need to turn on macro support in that specific program — the process is different in each one.
In Microsoft Excel, macros are disabled by default. When you open a file containing a macro, Excel shows a yellow warning bar below the ribbon that says "Security Warning: Macros have been disabled." Click "Enable Content" on that bar to turn on macros for that file only. If you want to enable macros permanently for files from a trusted source, go to File > Options > Trust Center > Trust Center Settings > Macro Settings, then select "Enable All Macros" — though Microsoft recommends against this for security reasons.
In Microsoft Word, the process is nearly identical. Word displays the same yellow warning bar when you open a document with macros. Click "Enable Content" to allow the macros to run. To change the default setting, go to File > Options > Trust Center > Trust Center Settings > Macro Settings and choose your preference. Word also lets you designate a folder as a "Trusted Location" — any files in that folder will run macros without prompting you.
In Google Docs, macros work differently because Google Docs runs in your browser. You do not enable or disable macros the way you do in Excel or Word. Instead, you write macros using Google Apps Script, which is built into Google Docs. To access it, open a Google Doc, go to Extensions > Apps Script, and you can write or paste a macro there. Google Docs runs the macro when you trigger it from the Extensions menu.
Key Takeaways
- Excel and Word show a yellow warning bar when you open a file with macros; click "Enable Content" to run them for that file.
- To enable macros by default in Excel or Word, go to File > Options > Trust Center > Trust Center Settings > Macro Settings and select "Enable All Macros," though this reduces security.
- Word lets you mark specific folders as "Trusted Locations" so macros in those folders run without prompting.
- Google Docs does not have a macro on/off switch; instead, you write or paste macros directly into Apps Script from the Extensions menu.
Why Excel and Word disable macros by default
Macros can contain malicious code that steals data, installs unwanted software, or damages your files. Because a macro can do almost anything a person could do in the program, Microsoft locks them down unless you explicitly turn them on. This is why you see the warning bar — it is asking you to confirm that you trust the file before running its code.
The safest approach is to enable macros only for files you recognize and trust. If someone sends you an Excel file with a macro and you are not sure what it does, ask them to explain it before you click "Enable Content." If the file comes from an unknown source, do not enable the macro.
The difference between enabling macros once and permanently
When you click "Enable Content" on the warning bar, you are turning on macros for that one file only. The next time you open a different file with macros, you will see the warning bar again and need to click "Enable Content" again. This is the safer option because it forces you to make a conscious choice each time.
If you change the macro setting in Trust Center to "Enable All Macros," every file you open will run macros without asking. This is faster if you work with many macro-enabled files, but it removes a layer of protection. Microsoft's middle-ground option, "Disable All Macros Except Digitally Signed Macros," lets macros run only if they come from a publisher you have marked as trusted — this requires the macro author to have a digital certificate.
How to create a trusted location in Word
A trusted location is a folder on your computer where Word automatically runs macros without showing the warning bar. This is useful if you have a folder where you keep your own macro-enabled templates or files from a colleague you work with regularly.
To set up a trusted location, open Word and go to File > Options > Trust Center > Trust Center Settings > Trusted Locations. Click "Add New Location," then browse to the folder you want to trust. Check the box that says "Subfolders of this location are also trusted" if you want Word to trust files in any subfolder inside that location. Click OK, then OK again to save the change.
Excel has the same trusted location feature in the same menu path. Once you add a folder as trusted in one program, you may need to add it separately in the other program — they do not always share the same trusted location list.
What to do if you cannot find the macro settings
If you are using a very old version of Excel or Word, the menu path might be slightly different. In Excel 2007 or Word 2007, go to Office Button > [Program] Options instead of File > Options. The Trust Center Settings are in the same place after that.
If you are using Excel or Word on a Mac, the path is [Program] > Preferences > Security instead of File > Options. The Trust Center and Macro Settings are in the same location within that menu.
If your computer is managed by a workplace or school, your IT department may have locked down the macro settings so you cannot change them. In that case, you will need to contact your IT support to request permission to enable macros for specific files.
Frequently Asked Questions
What happens if I enable a macro and it does something I did not expect?
Once a macro runs, it has already executed its code. If the macro made unwanted changes to your document or spreadsheet, you can undo those changes by pressing Ctrl+Z (or Cmd+Z on Mac) immediately after you notice the problem. If you are concerned about what a macro will do, ask the person who sent it to you to walk you through it step by step before you enable it.
Can I see what code is inside a macro before I enable it?
Yes. In Excel or Word, press Alt+F11 to open the Visual Basic Editor, which shows you the code inside any macros in the current file. If you do not recognize the code or it looks suspicious, do not enable the macro. In Google Docs, go to Extensions > Apps Script to see the code for any macros attached to that document.
Do I need to enable macros every time I open the same file?
No. Once you click "Enable Content" for a file, Excel and Word remember that choice for that specific file. The next time you open it, the macro will run without showing the warning bar again. If you open a different file with macros, you will see the warning bar again.
Why does Google Docs not have a macro on/off switch like Excel?
Google Docs runs in your web browser, not as a desktop program, so it handles macros differently. Google Apps Script (the macro system for Google Docs) runs in a sandboxed environment that is already protected by your browser's security. You write macros directly into Apps Script rather than opening files that contain them, so there is no need for a warning bar or an on/off switch.