What macros are and why you might need to enable them
A macro is a recorded set of actions that a program plays back automatically when you trigger it. Someone might create a macro to format a spreadsheet the same way every time, or to fill in repetitive text in a document. When you open a file that contains a macro, your program usually blocks it by default for security reasons — macros can potentially carry harmful code if they come from an untrusted source.
Enabling a macro means telling your program "I trust this file, run the macro when I ask it to." The steps differ depending on whether you use Microsoft Office (Excel or Word), Google Docs, or another program. This guide walks you through each one.
Key Takeaways
- Microsoft Office blocks macros by default and shows a yellow warning bar at the top of the file — click "Enable Content" to turn them on.
- Google Docs does not use macros in the traditional sense; instead it uses Apps Script, which you access through the Extensions menu.
- Only enable macros in files you trust, because macros can run code that affects your computer or data.
- If you create your own macros in Excel or Word, you must save the file as a macro-enabled format (.xlsm or .docm) for them to work.
Enabling macros in Microsoft Excel
When you open an Excel file that contains a macro, a yellow bar appears below the ribbon with the message "Security Warning: Macros have been disabled." Click the "Enable Content" button on that bar. Excel will then run the macro when you trigger it — usually by clicking a button in the spreadsheet or pressing a keyboard shortcut the macro creator set up.
If you do not see the warning bar, the file may not contain any macros, or macros may already be enabled. You can also check the Developer tab — if it exists, macros are likely enabled. If the Developer tab is missing, go to File > Options > Customize Ribbon, check the box next to "Developer," and click OK.
If you want to enable macros permanently for all files from a specific folder (for example, a shared drive where you store trusted templates), you can add that folder to Excel's Trusted Locations. Go to File > Options > Trust Center > Trust Center Settings > Trusted Locations, then click "Add New Location" and browse to the folder. Any file opened from that folder will run macros without the warning.
Enabling macros in Microsoft Word
Word works the same way as Excel. When you open a document with a macro, a yellow security bar appears saying "Security Warning: Macros have been disabled." Click "Enable Content" and the macro is active. The macro creator will have set up a way to run it — often a button in the document or a keyboard shortcut.
Like Excel, you can add trusted folders in Word by going to File > Options > Trust Center > Trust Center Settings > Trusted Locations. This is useful if you regularly work with macro-enabled templates from your company or a known source.
Using macros in Google Docs (Apps Script)
Google Docs does not use macros in the traditional sense. Instead, it uses Apps Script, which is Google's programming language for automating tasks. If someone has created an automation for a Google Doc, you access it through the Extensions menu at the top of the page.
Click Extensions > Apps Script to open the script editor. If a script already exists in the document, you will see it here. To run it, look for a play button (▶) in the toolbar, or the script creator may have added a custom menu item under Extensions that you can click directly. Google Docs does not block scripts the way Excel blocks macros, but you should only run scripts from sources you trust.
Creating and saving your own macros
If you want to record your own macro in Excel or Word, you use the Record Macro feature. In Excel, go to Developer > Record Macro, give it a name, and choose whether to store it in this workbook or your personal macro workbook. Then perform the actions you want to record — Excel captures every click and keystroke. When you are done, click Developer > Stop Recording.
The critical step: save the file as a macro-enabled format. In Excel, use File > Save As and choose "Excel Macro-Enabled Workbook (.xlsm)" instead of the standard .xlsx format. In Word, choose "Word Macro-Enabled Document (.docm)" instead of .docx. If you save as the regular format, your macro will be lost.
Once saved, the macro is part of that file. Anyone who opens it will see the security warning and can click "Enable Content" to run it. You can also assign the macro to a button or keyboard shortcut so users do not have to hunt for it.
What to do if you see a macro warning but do not trust the source
If you open a file and see the macro security warning, but you are not sure whether the file is safe, do not click "Enable Content." Instead, close the file and contact the person who sent it to you. Ask them what the macro does and whether they created it themselves.
Macros can be written to steal data, install unwanted software, or modify files without your knowledge. If you received the file from an unexpected source or the sender cannot explain what the macro does, it is safer to delete it. If you need the file's contents but not the macro, you can often copy the data into a new file without the macro code.
Troubleshooting: macro button or menu item does not appear
If you enabled content but the macro button or menu item still does not show up, the macro may not have been set up with a visible trigger. Ask the file creator how to run the macro — they may need to add a button or menu item, or tell you the keyboard shortcut.
Another common issue: you enabled content, but when you close and reopen the file, the warning bar appears again. This happens if you opened the file from an email attachment or a blocked network location. Right-click the file, select Properties, check the box that says "Unblock," and click OK. Then open it again — the warning should not reappear.
Frequently Asked Questions
Can I enable macros for just one time, or do I have to enable them every time I open the file?
In Excel and Word, once you click "Enable Content," macros stay enabled for that session. If you close and reopen the file, the warning bar appears again and you must click "Enable Content" again. To avoid this, add the file's folder to your Trusted Locations, or unblock the file through its Properties if it came from an email or network drive.
What is the difference between enabling a macro and trusting a file?
Enabling a macro means running it this time. Trusting a file (by adding its folder to Trusted Locations or unblocking it in Properties) means you will not see the warning again. Trust is a stronger action and should only be used for files you are certain are safe.
If I enable a macro, can it change files on my computer outside of the document I opened?
Yes, a macro can potentially access and modify other files, depending on what the macro code does and what permissions your account has. This is why you should only enable macros in files from trusted sources. If you are unsure, ask the file creator exactly what the macro accesses before you enable it.
Do I need to enable macros every time I use a template with a macro?
If you save the template to a Trusted Location folder, you will not see the warning bar and macros will run automatically. If you keep it elsewhere, you will see the warning each time you open a file based on that template. Adding the template folder to Trusted Locations is the easiest solution for templates you use regularly.
Can I see what a macro does before I enable it?
Yes. In Excel or Word, click Developer > Visual Basic (or press Alt+F11) to open the code editor. You can read the macro code, though you may need some programming knowledge to understand it. If the code looks suspicious or you cannot read it, do not enable the macro — contact the file creator instead.