How to Fix Disabled Macros in Microsoft Access Immediate Window
Question details
The user needs to execute VBA code in the Microsoft Access Immediate Window but is blocked by an error stating that macros are disabled, even though all macros were previously enabled.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Attempting to run VBA scripts or debug code directly within the Microsoft Access Immediate Window.
- Observed behavior
- The Immediate Window fails to run the VBA code and prompts an error message stating that macros are disabled.
Verify that the Access database or front-end file you are trying to run is from a secure, trusted source before adjusting your Trust Center security settings.
Add the Database Folder to Trusted Locations
Configure the Microsoft Office Trust Center to recognize the folder containing your database as a trusted location, allowing macros to bypass security blocks.
When an Access database is stored in a folder that Microsoft Office does not recognize as secure, enabling all macros globally may not be enough to run VBA code. By adding the specific folder to your Trusted Locations list, you instruct Microsoft Access to allow all scripts and macros within that directory to run without triggering security warnings.
Launch Microsoft Access. Click on the 'File' tab in the top-left corner and select 'Options' at the bottom of the menu.
In the Access Options window, select 'Trust Center' from the left-hand navigation pane, then click the 'Trust Center Settings' button.
Choose 'Trusted Locations' from the left sidebar of the Trust Center window. Click the 'Add new location' button at the bottom of the dialog box.
Click 'Browse' to locate the folder containing your Access database or front-end file. If your files are organized in subdirectories, check the 'Subfolders of this location are also trusted' box.
Click 'OK' to save your new trusted location. Restart Microsoft Access and test running your VBA code in the Immediate Window again.

Enhance Your Productivity with WPS Office
While Microsoft Access serves as a dedicated database tool, you can handle all your daily document, spreadsheet, and presentation needs with WPS Office. Enjoy lightweight performance, advanced macro support in spreadsheets, and complete compatibility with Microsoft Office file formats for free.
- 1. Download the Installer: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install WPS Office: Run the downloaded installer file and follow the brief on-screen instructions to complete the setup.
- 3. Open Your Files: Launch WPS Office and seamlessly open your existing Microsoft Word, Excel, or PowerPoint documents to continue working.

Frequently Asked Questions
Why does Access still say macros are disabled after I enabled them globally?
Microsoft Office uses the Trust Center to manage file security. If your database is stored in an unverified local directory or a network drive, Office may still block macros for your safety. Adding the folder directly to Trusted Locations overrides these folder-level restrictions.
Is it safe to check 'Subfolders of this location are also trusted'?
Yes, as long as the parent folder is strictly managed by you and only contains trusted files. It is highly useful if your Access database relies on multiple linked files organized across various subdirectories.
Can I use this same method to fix disabled macros in Excel or Word?
Absolutely. The Microsoft Office Trust Center architecture is standardized across its main applications. You can navigate to File > Options > Trust Center in Word or Excel to add trusted locations for your text documents and spreadsheets.




