What macros are and why you need to enable them
A macro is a recorded set of actions that runs automatically when you trigger it — usually a keyboard shortcut or a button click. In Excel, Word, and Google Sheets, macros let you repeat the same steps without doing them by hand each time. You might use a macro to format a spreadsheet the same way every month, fill in standard text in a document, or reorganize data in a specific pattern.
By default, most programs disable macros because they can be used maliciously. A macro from an untrusted source could theoretically delete files or steal information. When you open a file that contains macros, your program will warn you and ask whether to enable them. You need to say yes — or change your settings — before the macro will run.
This guide covers how to enable macros in the three programs where you are most likely to encounter them: Microsoft Excel, Microsoft Word, and Google Sheets. The steps differ between programs and between Windows and Mac.
Key Takeaways
- Macros are disabled by default in Excel and Word for security reasons, and you must enable them in the file itself or change your program settings.
- In Excel and Word on Windows, you can enable a macro for just that one file when you open it, or change your settings to trust all files from a specific folder.
- Google Sheets does not disable macros the same way — you authorize them the first time you run one, and the process is simpler than in Excel or Word.
- If you created the macro yourself or received it from someone you trust, it is safe to enable; if you are unsure about the source, do not enable it.
Enabling macros in Excel on Windows
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. The macro will now run in that file for the rest of your session.
If you want to enable macros permanently for files in a specific folder — for example, a folder where you keep your own macros — you can add that folder to Excel's trusted locations. Open Excel and go to File > Options > Trust Center > Trust Center Settings > Trusted Locations. Click "Add New Location," browse to your folder, and check the box that says "Subfolders of this location are also trusted." From then on, any macro in that folder will run without the warning.
If you want to enable macros for all files you open (not recommended unless you are certain about your sources), go to File > Options > Trust Center > Trust Center Settings > Macro Settings. Select "Enable All Macros" and click OK. This removes the security warning entirely, so use this setting only if you work exclusively with files you created or received from trusted sources.
Enabling macros in Excel on Mac
Excel on Mac handles macros differently than Windows. When you open a file with macros, a bar appears asking "Do you want to enable macros in this workbook?" Click "Enable Macros." The macro will run in that file.
To change your default macro settings on Mac, open Excel and go to Excel > Preferences > Security. You will see options for macro security. The default setting is "Disable all macros with notification," which is the safest. If you want to trust a specific folder, you cannot do so in the same way as Windows — instead, you can only change the global setting. Select "Enable all macros" if you work only with trusted files, but this is not recommended for most users.
Enabling macros in Word on Windows
Word on Windows works the same way as Excel. When you open a document with macros, a yellow security bar appears below the ribbon. Click "Enable Content" to run the macro in that document.
To add a folder to Word's trusted locations, go to File > Options > Trust Center > Trust Center Settings > Trusted Locations. Click "Add New Location," select your folder, check "Subfolders of this location are also trusted," and click OK. Any macro in that folder will now run without a warning.
To enable all macros globally in Word, go to File > Options > Trust Center > Trust Center Settings > Macro Settings and select "Enable All Macros." Again, do this only if you are certain about your sources.
Enabling macros in Word on Mac
When you open a Word document with macros on Mac, you will see a message asking whether to enable them. Click "Enable Macros" and the macro will run.
To change your settings, open Word and go to Word > Preferences > Security. The default is "Disable all macros with notification." You can change this to "Enable all macros," but the same caution applies: do this only if you trust all the documents you open.
Enabling macros in Google Sheets
Google Sheets does not disable macros by default the way Excel and Word do. Instead, the first time you run a macro (or Apps Script, which is Google's version of macros), a dialog box appears asking you to authorize it. Click "Review Permissions," then click "Allow" when prompted. Google will ask which account to use and show you what the script can access — for example, whether it can read and modify your spreadsheet.
Once you authorize a script, it will run without asking again the next time you use it. If you want to revoke permission later, go to your Google Account settings, find "Connected apps & sites" or "Third-party apps with account access," and remove the script from the list.
If you are the one writing the macro in Google Sheets using Apps Script, you do not need to enable anything — you can run it directly from the script editor.
What to do if you are unsure about a macro
If someone sent you a file with a macro and you are not sure whether it is safe, do not enable it. Instead, ask the person who sent it to you what the macro does and why they included it. If they cannot give you a clear answer, or if the file came from an unknown source, it is safer to decline.
If you need to see what a macro does before enabling it, you can open the file in Excel or Word and look at the macro code. In Excel, go to Tools > Macro > Edit Macros (on Mac) or View > Macros > View Macros (on Windows). In Word, go to Tools > Macro > Macros (on Mac) or View > Macros > View Macros (on Windows). The code will appear in a window. If you cannot read the code or do not recognize what it does, do not enable the macro.
Frequently Asked Questions
Can a macro from an Excel file infect my computer with a virus?
A macro itself is not a virus, but a malicious macro could theoretically perform harmful actions if you enable it. This is why Excel and Word disable macros by default. If you enable a macro from an untrusted source, you are taking a risk. Only enable macros from people and organizations you trust.
Why does my macro not run even after I clicked Enable Content?
The most common reason is that you enabled the macro for that session only, and then closed and reopened the file. You will need to enable it again. If you want it to run automatically every time you open the file, add the file's folder to your trusted locations instead.
If I enable macros in one file, does it enable them in all my files?
No. Enabling a macro for one file does not affect other files. Each time you open a new file with macros, you will see the warning again. If you want to avoid the warning for files in a specific folder, add that folder to your trusted locations.
Can I undo a macro after it runs?
Yes, in most cases. If the macro made changes to your spreadsheet or document, you can press Ctrl+Z (or Command+Z on Mac) to undo the last action. However, some macros perform multiple actions at once, so you may need to undo several times. If you are testing a macro for the first time, save a copy of your file first.
What is the difference between a macro and a script in Google Sheets?
In Google Sheets, "Apps Script" is Google's name for what Excel and Word call macros. They do the same thing — automate repeated actions. Google does not disable them by default, but it does ask you to authorize them the first time you run one, which is a similar safety measure.