logo
search
Office Settings & Configuration

How to Fix a Word AutoExec Macro That Does Not Open a Document

WPS Content ManagerWPS Content Manager Oct 10, 2026 868 views

Question details

The user needs a Word macro to automatically open a specific document when the application starts, but the current macro is failing to execute properly.

How to Fix a Word AutoExec Macro That Does Not Open a Document
Product
Microsoft Word
Device & OS
not provided
Scenario
Setting up Word to automatically open a frequently used document on startup using an AutoExec macro.
Observed behavior
The macro does not open the document upon starting Word, possibly due to incorrect naming, wrong template location, or macro security settings blocking execution.
Before you start

Ensure you have the exact file path to the document you want to open and verify that your Word macro security settings in the Trust Center allow scripts to run.

Solution 1Recommended

Manually Configure the AutoExec Macro in the Normal Template

Use the Visual Basic Editor to correctly name and place the AutoExec subroutine in the Normal template, ensuring Word triggers it perfectly upon launch.

The macro recorder is not always reliable for setting up startup scripts. Manually adding the AutoExec procedure to a standard module inside your Normal template is the most robust method to ensure a document opens automatically.

1
Open the Visual Basic Editor

Launch Microsoft Word and press Alt + F11 on your keyboard to open the Visual Basic Editor.

2
Insert a Module in the Normal Template

In the left Project pane, locate 'Normal'. Right-click on it, select 'Insert', and then click 'Module'. You can also use an existing module like Module1.

3
Add the AutoExec Code

In the main code window, type the AutoExec subroutine and use the complete file path. For example: `Sub AutoExec() On Error Resume Next Documents.Open "C:\Users\YourName\Documents\Scratchpad.docx" End Sub`.

4
Save and Restart

Save the changes to your Normal template in the editor, close the Visual Basic Editor, and restart Word to test if the document automatically opens.

Manually Configure the AutoExec Macro in the Normal Template
Macro Security Warning: If you receive a prompt indicating macros are disabled when restarting Word, you must click 'Enable Content' or adjust your macro settings in the Trust Center for the AutoExec script to function.
Free Microsoft Office alternative

Try WPS Office for Seamless Document Management

If you want to avoid complex macro configurations in Microsoft Word, consider switching to WPS Office. It provides a lightweight, intuitive interface, built-in tabbed document management, and excellent compatibility with Microsoft Office file formats.

  1. 1. Download and Install: Visit the official WPS website to download and install the free WPS Office suite.
  2. 2. Open Your Documents: Launch WPS Writer and easily open or pin your frequently used documents using the intuitive tabbed workspace.
Highly compatible with Microsoft Word (.docx) formats and templatesLightweight and fast startup without the need for complex configurationsFree to use with a familiar, user-friendly interfaceBuilt-in tabbed interface for managing and opening multiple documents easily
microsoft office alternative - wps office

Frequently Asked Questions

Why does my recorded Word macro fail to open documents on startup?

The macro recorder can sometimes be unreliable for capturing application-level events like startup actions. It is highly recommended to manually write or verify the VBA code in the Visual Basic Editor using the standard 'AutoExec' naming convention.

Where must an AutoExec macro be saved to work properly?

An AutoExec macro must be stored in a standard module within the Normal template (Normal.dotm). This ensures that the macro loads automatically into the application's memory every time Word is launched.

Can macro security settings prevent my AutoExec script from running?

Yes, if your Word Trust Center settings restrict macros, the AutoExec macro will be blocked from executing. You must either set your macro security to enable all macros or place the target document and template in a Trusted Location.