VBA & Macro Problems

Fix Word Macro Buttons in a .dotm Template

Camila MilosovichCamila Milosovich Nov 20, 2026 869 views

Question details

The user needs custom Word macro buttons to work after saving a macro-enabled document as a template.

Fix Word Macro Buttons in a .dotm Template
Product
Microsoft Word
Device & OS
not provided
Scenario
A .docm document with custom macro buttons is saved as a .dotm template while its macros and toolbar customizations are stored in different templates.
Observed behavior
Custom buttons may fail with Run-time error 424 after the conversion.
Before you start

Open the .dotm template directly in desktop Word and identify where the macros and buttons are currently stored. Enable macros only if the file and its code come from a trusted source.

Solution 1Recommended

Store the macros and Quick Access Toolbar buttons in the same template

Use this approach when buttons saved in the .dotm template point to macros in Normal.dotm or another template.

Recreating the button assignment after moving the macro can restore the link to the correct template. Error 424 can also have other causes, so this is a targeted fix rather than a guarantee.

1
Open the template

In Word, select File > Open and open the .dotm file itself, rather than creating a new document from it.

2
Locate the macros

Open the VBA editor with Alt+F11 and use the Project Explorer to find the macro modules in Normal or the other source template.

3
Copy the macro modules

In the VBA editor, export the required modules from the source project, then select the target .dotm project and import them through File > Import File. Include any required forms, references, or other code dependencies.

4
Reassign the buttons

In Word, open File > Options > Quick Access Toolbar. Select the .dotm template as the customization scope if available, remove the old macro button, and add the macro from the target template using the Macros command list.

5
Save and test

Save and reopen the .dotm template, then select the rebuilt button. Also test a new document created from the template.

Store the macros and Quick Access Toolbar buttons in the same template
Custom Ribbon buttons: If the template uses custom Ribbon XML, check that its callback names match procedures available in the template. The Quick Access Toolbar settings do not edit custom Ribbon XML.
Free Microsoft Office alternative

Work with Word Documents in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for opening and editing Word documents. Its format support helps you move everyday files between Office suites; it does not repair Word's template or macro-button links.

Open and edit Microsoft Word DOCX and DOC filesUse a familiar interface for everyday document editingKeep working with Word documents without relying on custom macro buttonsMove compatible documents between WPS Office and Microsoft Office
microsoft office alternative - wps office

Frequently Asked Questions

Why did my macro button stop working after I saved the document as a template?

The button may still refer to a macro in Normal.dotm or another template. Copy the macro to the .dotm file and recreate the button under File > Options > Quick Access Toolbar.

Does error 424 always mean the button points to the wrong template?

No. Error 424 means an object is required and can also occur inside the macro code. If reassigning the button does not help, use the VBA editor's Debug option to inspect the failing line and its object references.

How can I tell where a Word macro is stored?

Open the VBA editor with Alt+F11 and check Project Explorer for the macro's module under Normal or an open document or template project.

Can I use a .docm file as a template without changing its extension?

A .docm file is a macro-enabled document, not a Word template. To create a template, use File > Save As and choose Word Macro-Enabled Template (.dotm), then verify the macros and button assignments.